How to comment a line in thea GM script?

9,891 views
Skip to first unread message

Ben

unread,
Mar 7, 2013, 8:30:58 AM3/7/13
to greasemon...@googlegroups.com
How do I tell GM that a line is just a comment and should not be executed?
 
I though "//" at the beginning (or somewhere in the mid) of a line would do the trick (=mark the remaining part right of it as a comment)
 
But this seems to be not the case.
 
When I tried it out commenting out for a script command then unpredicatable results occur.
 
So is there a real safe comment tag?
 
Ben

.

unread,
Mar 7, 2013, 9:42:14 AM3/7/13
to greasemon...@googlegroups.com
// don't work?
thats weird, maybe you are using a editor that somehow is nuking the newlines.

/* */ is the block comment from C that javascript support, you can
comment a line just by enclosing it in the /* and */ symbol.

this will work, even if your text editor do something vile with \n
> --
> You received this message because you are subscribed to the Google Groups
> "greasemonkey-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to greasemonkey-us...@googlegroups.com.
> To post to this group, send email to greasemon...@googlegroups.com.
> Visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
--
ℱin del ℳensaje.

Ben

unread,
Mar 10, 2013, 5:02:51 AM3/10/13
to greasemon...@googlegroups.com
Does the newline \n in GM scripts have to be in
 
- Windows style Hex 0D 0A
or
- in Unix Style Hex \0A
 
or is it not relevant (=both are accepted)?
 

On Thursday, March 7, 2013 3:42:14 PM UTC+1, Tei wrote:
// don't work?
thats weird, maybe you are using a editor that somehow is nuking the newlines.

/* */   is the block comment from C that javascript support,  you can
comment a line just by enclosing it in the /* and */ symbol.

this will work, even if your text editor do something vile with  \n

On 7 March 2013 14:30, Ben <bxst...@yahoo.co.uk> wrote:
> How do I tell GM that a line is just a comment and should not be executed?
>
> I though "//" at the beginning (or somewhere in the mid) of a line would do
> the trick (=mark the remaining part right of it as a comment)
>
> But this seems to be not the case.
>
> When I tried it out commenting out for a script command then unpredicatable
> results occur.
>
> So is there a real safe comment tag?
> Ben


--
--
ℱin del ℳensaje.

Sam Larison

unread,
Mar 10, 2013, 10:51:47 AM3/10/13
to greasemon...@googlegroups.com
If you are trying to use the comment in a script header then you will probably get unpredictable results, otherwise they should work as expected.  Any sort of newline should work.


--
Reply all
Reply to author
Forward
0 new messages