REM: Difference between revisions
Jump to navigation
Jump to search
Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link
(Created page with "'''REM''' or an apostrophe is used for programmer remarks, comments or to stop the execution of program code. {{PageSyntax}} :: REM program comment or ignore code {{PageDescription}} * Comments cannot be read by Qbasic correctly and may cause syntax and other errors without REM! * Instead of REM you can use the {{KW|REM|'}} symbol which can be put anywhere. * Code can also be commented out for program testing purposes. * Qbasic Metacommands such as {{KW|$DYNAMIC}} an...") |
No edit summary |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 7: | Line 7: | ||
{{PageDescription}} | {{PageDescription}} | ||
* Comments cannot be read by | * Comments cannot be read by QBasic correctly and may cause syntax and other errors without REM! | ||
* Instead of REM you can use the | * Instead of REM you can use the [[REM|']] symbol which can be put anywhere. | ||
* Code can also be commented out for program testing purposes. | * Code can also be commented out for program testing purposes. | ||
* | * QBasic Metacommands such as [[$DYNAMIC]] and [[$INCLUDE]] require the use of REM or the apostrophe. | ||
''Example:'' Avoiding an END IF error. | ''Example:'' Avoiding an END IF error. | ||
{{CodeStart}} | {{CodeStart}} | ||
{{Cl|REM}} This is a remark... | {{Cl|REM}} This is a remark... | ||
' This is also a remark... | ' This is also a remark... | ||
{{Cl|IF...THEN|IF}} a = 0 {{Cl|THEN}} {{Cl|REM}} (REM follows syntax rules) | {{Cl|IF...THEN|IF}} a = 0 {{Cl|THEN}} {{Cl|REM}} (REM follows syntax rules) | ||
{{Cl|IF...THEN|IF}} a = 0 {{Cl|THEN}} '(apostrophe doesn't follow syntax rules, so use END IF after this) | {{Cl|IF...THEN|IF}} a = 0 {{Cl|THEN}} '(apostrophe doesn't follow syntax rules, so use END IF after this) | ||
{{Cl|END IF}} | {{Cl|END IF}} | ||
{{CodeEnd}} | {{CodeEnd}} | ||
{{PageSeeAlso}} | {{PageSeeAlso}} | ||
* [https://qb64phoenix.com/forum/showthread.php?tid=1130 Featured in our "Keyword of the Day" series] | |||
* [[Apostrophe]] | * [[Apostrophe]] | ||
* | * [[$DYNAMIC]], [[$STATIC]], [[$INCLUDE]] | ||
{{PageNavigation}} | {{PageNavigation}} |
Latest revision as of 19:49, 24 May 2024
REM or an apostrophe is used for programmer remarks, comments or to stop the execution of program code.
Syntax
- REM program comment or ignore code
Description
- Comments cannot be read by QBasic correctly and may cause syntax and other errors without REM!
- Instead of REM you can use the ' symbol which can be put anywhere.
- Code can also be commented out for program testing purposes.
- QBasic Metacommands such as $DYNAMIC and $INCLUDE require the use of REM or the apostrophe.
Example: Avoiding an END IF error.
REM This is a remark... ' This is also a remark... IF a = 0 THEN REM (REM follows syntax rules) IF a = 0 THEN '(apostrophe doesn't follow syntax rules, so use END IF after this) END IF |
See also