BASIC Programming/Beginning BASIC/Documentation
< BASIC Programming < Beginning BASICIntroduction
In Basic, code is documented in one of two ways:
- The REM statement
- an Apostrophe: (')
Either of these two methods will result in treating the rest of the line as a comment.
As with most forms of code documentation, it needs to be used as programs grow larger and to help identify the purpose of a given section of code. It is unnecessary to document every individual line, but should give enough information such as the purpose of a given function or why a certain statement may be needed.
Code
Example 1 (qBasic)
CLS
10 PRINT "Hello World!"
20 REM This code will display Hello World! to the display.
30 END
Example 2 (freeBasic)
print "Hello World!"
'This code will display Hello World! on the screen
sleep
end
Explanation
This will allow you to create a Remark statement that will not be visable to the user, but will be visable when the code is reviewed.
Previous: Variables and Data Types | Main: BASIC Programming | Next: Documentation |
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.