Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The text of comments does not affect the size of the object code. However, each line of a comment adds one linemark (one character) to the compiled program.

Syntax

...

Code Block
*

...

  { characters}!

...

  { characters}
/*  

...

{ characters}

...

  */

...

Single-line Comments

The comment operators * and ! indicate single-line comments. All characters from the comment operator to the end of the physical line are ignored by the compiler.

Comments can be placed on the same physical line as other BASIC+ statements by using a semicolon (;) to separate the two statements. In this case, all characters to the end of the line are ignored, even if there are additional statements separated by a semicolon. For example:

Code Block
For CTR = 1 To 10 ; * loop through 10 times

...

Multi-line Comments

You can create comments that span several lines by using the comment operators /* (to open a comment block) and */ (to close the block). Any number of lines can come between the Comment operators. The compiler will ignore all text between the multi-line Comment operators.

Example

 

Code Block
/* program FIELD.REPORT

...

  author:  

...

John Doe

...

  date:   

...

01/01/89 */
! data (shelf #, type, title, composer, artist)
 
/* All the elements of CUST (I) from 1 to the highest key are written to the output file. */
If C = " " Then Go 3 Else Go 5; * test for spaces

...