Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rem keyword vs // vs /*

Can someone please explain:

Is there a rule or condition like when to use Rem Keyword vs // vs /* for commenting in a script? The reason I am asking this is all three serves the same purpose

Thanks!

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Hi Karthick,

  //  is for single line comments.


Ex:  // This is a comment.


  /* …*/  is for multi line comment. Multiline comments are used to comment out block of code.


Ex:    /* This is a comment

            that spans two lines */


  Rem is a short for Remarks. The rem statement is used for inserting remarks or comments or comment out the lines. Everything between the Rem and the next semicolon ; is considered to be a comment.


Ex:

Capture.PNG

Hope this helps.

View solution in original post

3 Replies
vishsaggi
Champion III
Champion III

True. I generally follow this:

Rem and // Is used for single line statement commenting.

/*  */ This is used if you have many lines/a block of script statements to be commented in a single go.

Thanks,
Vish.

tamilarasu
Champion
Champion

Hi Karthick,

  //  is for single line comments.


Ex:  // This is a comment.


  /* …*/  is for multi line comment. Multiline comments are used to comment out block of code.


Ex:    /* This is a comment

            that spans two lines */


  Rem is a short for Remarks. The rem statement is used for inserting remarks or comments or comment out the lines. Everything between the Rem and the next semicolon ; is considered to be a comment.


Ex:

Capture.PNG

Hope this helps.

Anonymous
Not applicable
Author

Thanks Vish Nagaraju that makes sense