A command which everyone thinks they know flawlessly, and yet, they probably don't.
What is it? REM is a command that allows people to place remarks inside a program so that it helps clarify what's going on and makes it much easier to come back to the program at a future time and understand just what the BLEEP the programmer was thinking when he coded everything originially.
How to use it? Just add REM to where you want to place a comment, and then type out your comment!
And with the basic description of this most basic command out of the way, let's touch back upon the opening sentence which begins this post, where I claimed: most folks don't know everything about REM, like they think they do. WTH is up with that?? "What are people misunderstanding", you ask?
Most people think that REM and ' (the single quote) are interchangeable and completely the same. In fact, most people think that ' (the single quote) is nothing more than a shortcut to reduce typing out the whole word REM.
This isn't true!!
REM is a *COMMAND*.
' (the single quote) is part of a *COMMENT*.
With REM, REM is an actual command which basically says, "Hey, everything past this point is a comment!"
With ' (the single quote), ' is PART of the comment itself, and is basically excluded from your code.
A subtle difference, but one which can have drastic effects upon a program. Let's take the following code for example:
Now, at first glance, those two statements look *exactly* alike. They're not.
The first code box contains a single-line IF statement, whereas the second code box contains the start of a multi-line IF statement. You're going to have to put an END IF in the second code box, or else run into all sorts of errors in your code.
WHY??
Because you ended the first IF statement with a command. Sure, it's a command which says, "A comment is coming next," but it's still a command. Think of it just like you would: IF foo THEN PRINT. That command (REM, in this case) is enough to close up that IF statement and make it a valid single-line statement.
On the other hand, the second segment of code is basically just IF foo THEN.... Then WHAT?? You're not telling that IF statement what to do on that line, so it's got to be a multi-line IF statement.
REM is a *COMMAND*, just like GOTO, PRINT, and all the other commands in the language. It's just a command which says, "Comments to the right!"
' (the single quote) is an actual part of a comment, and is basically ignored when used as one inside your programs. It's not a command, and that's the biggest difference -- and it's a significant one -- between the two.
What is it? REM is a command that allows people to place remarks inside a program so that it helps clarify what's going on and makes it much easier to come back to the program at a future time and understand just what the BLEEP the programmer was thinking when he coded everything originially.
How to use it? Just add REM to where you want to place a comment, and then type out your comment!
And with the basic description of this most basic command out of the way, let's touch back upon the opening sentence which begins this post, where I claimed: most folks don't know everything about REM, like they think they do. WTH is up with that?? "What are people misunderstanding", you ask?
Most people think that REM and ' (the single quote) are interchangeable and completely the same. In fact, most people think that ' (the single quote) is nothing more than a shortcut to reduce typing out the whole word REM.
This isn't true!!
REM is a *COMMAND*.
' (the single quote) is part of a *COMMENT*.
With REM, REM is an actual command which basically says, "Hey, everything past this point is a comment!"
With ' (the single quote), ' is PART of the comment itself, and is basically excluded from your code.
A subtle difference, but one which can have drastic effects upon a program. Let's take the following code for example:
Code: (Select All)
IF foo THEN REM foo is a make-believe variable for my example!
Code: (Select All)
IF foo THEN 'foo is a make-believe variable for my example!
Now, at first glance, those two statements look *exactly* alike. They're not.
The first code box contains a single-line IF statement, whereas the second code box contains the start of a multi-line IF statement. You're going to have to put an END IF in the second code box, or else run into all sorts of errors in your code.
WHY??
Because you ended the first IF statement with a command. Sure, it's a command which says, "A comment is coming next," but it's still a command. Think of it just like you would: IF foo THEN PRINT. That command (REM, in this case) is enough to close up that IF statement and make it a valid single-line statement.
On the other hand, the second segment of code is basically just IF foo THEN.... Then WHAT?? You're not telling that IF statement what to do on that line, so it's got to be a multi-line IF statement.
REM is a *COMMAND*, just like GOTO, PRINT, and all the other commands in the language. It's just a command which says, "Comments to the right!"
' (the single quote) is an actual part of a comment, and is basically ignored when used as one inside your programs. It's not a command, and that's the biggest difference -- and it's a significant one -- between the two.