Comments: Difference between revisions
Content added Content deleted
No edit summary |
(Applesoft BASIC) |
||
Line 347: | Line 347: | ||
DIM a AS /' Comment in the middle of statement '/ Integer |
DIM a AS /' Comment in the middle of statement '/ Integer |
||
==={{header|Applesoft BASIC}}=== |
|||
Comment by making a REMark using the REM keyword |
|||
<lang qbasic>REM COMMENT AFTER THE REM KEYWORD</lang> |
|||
When LISTing the program a space is added after the REM keyword |
|||
<lang qbasic>0 REMLEAVE THE SPACE OUT AFTER THE REM WHEN TYPING OR PASTING</lang> |
|||
The remark extends until the end of the line. Only the first THIS IS CODE is printed. |
|||
<lang qbasic>10 PRINT "THIS IS CODE" : REM : PRINT "THIS IS CODE"</lang> |
|||
A comment can come after a GOSUB and when the subroutine returns it continues running the statements after the GOSUB comment. |
|||
<lang qbasic>20 GOSUB 110COMMENT: PRINT "THIS IS CODE"</lang> |
|||
Anything after a GOTO or RETURN statement is ignored. |
|||
<lang qbasic>30 GOTO 40"COMMENT: THIS IS A COMMENT</lang> |
|||
There are other ways to add spacing and comments to code. |
|||
<lang qbasic>:::::::::::::::::::::::::::::::::::::: |
|||
40 REM |
|||
50 : |
|||
60 REM<ctrl>+J |
|||
70 FOR I = 1 to 10 |
|||
80 ::::PRINT I;MID$("THIS IS A COMMENT",1,0) |
|||
90 NEXT</lang> |
|||
Typing CONTinue after the program ENDs will result in a ?SYNTAX ERROR. |
|||
<lang qbasic>100 END : THISISACOMMENT</lang> |
|||
Use the quotation symbol " before the comment so that spaces are included and keywords are ignored. |
|||
<lang qbasic>110 RETURN : "COMMENT FOR AND AT THE END</lang> |
|||
==={{header|BaCon}}=== |
==={{header|BaCon}}=== |
||
BaCon accepts '''REM''' (or single quote apostrophe) for line comments. |
BaCon accepts '''REM''' (or single quote apostrophe) for line comments. |
||
Line 376: | Line 400: | ||
print "Not a comment" // even this. |
print "Not a comment" // even this. |
||
print "Not a comment" rem and this !</lang> |
print "Not a comment" rem and this !</lang> |
||
=={{header|Batch File}}== |
=={{header|Batch File}}== |