Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

BASIC Programming/Beginning BASIC/Documentation

From Wikibooks, open books for an open world
<BASIC Programming

Introduction

[edit |edit source]

In Basic, code is documented in one of two ways:

  • a remark, indicated by theREM statement
  • a full-line comment introduced by an apostrophe: (')

Either of these two methods will result in treating the rest of the line as a comment.The interpreter will discard the rest of the line.

As with most forms of code documentation, it needs to be used as programs grow larger and to help identify thepurpose 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

[edit |edit source]
first example (qBasic)
CLS10PRINT"Hello World!"20REM This code will display Hello World! to the display.30END
second example (freeBasic)
print"Hello World!"'This code will display Hello World! on the screensleepend

Explanation

[edit |edit source]

This will allow you to create a Remark statement that will not be visible to the user, but will be visible when the code is reviewed.


Previous:Variables and Data TypesMain:BASIC ProgrammingNext:Documentation
Retrieved from "https://en.wikibooks.org/w/index.php?title=BASIC_Programming/Beginning_BASIC/Documentation&oldid=3691175"
Category:

[8]ページ先頭

©2009-2025 Movatter.jp