Program Format

An mvBASIC program is a sequence of statements directing the computer to perform a series of tasks in a specified order. A statement consists of keywords, constants, and variables.

Keywords

Special words recognized by the mvBASIC compiler.

Constants

Values that do not change during the execution of a program.

Variables

Values that can change.

An mvBASIC source line corresponds to a single attribute in the source code item. The line can begin with a statement label, but statement labels are not mandatory for all lines in mvBASIC. More than one mvBASIC statement can be placed on the same line, as long as they are separated by semicolons (;).

The syntax for an mvBASIC source line follows:

Format

[label] statement [; statement [; statement ...]]

Example

100   PRINT "HELLO, WORLD"  ;  PRINT "GOODBYE, WORLD"

In the example, the statement label is 100. It is followed by two PRINT statements, separated by a semicolon (;). In each statement, the word PRINT is a keyword and is followed by a constant string value ("HELLO WORLD" or "GOODBYE WORLD"), delimited by quotation marks.

A statement cannot be broken onto more than one line, unless it contains a comma in its syntax (for example, in the EQUATE, COMMON, or DIMENSION statements), in which case it can be broken into multiple lines after each comma.

The following topics are presented in this section:

Types of Statements

Statement Labels

Writing Readable Code

See Also

Format, Data and Expressions

Constants, Variables, and Data Types

Building Expressions

Advanced Data Types