Chapter 4. Basic Program Elements
53
4.1 Structure of a Program Line
4.1.1 Format of a Program Line
A program line consists of the following elements:
[label] [statement] [:statement] ... [comment]
• label
A label is placed at the beginning of a program line to identify lines.
• statement
A statement is a combination of functions, variables, and operators according to the syn-
tax.
A group of the statements is a program.
• comment
You may describe comments in order to make programs easy to understand.
[ 1 ] Labels
To transfer control to any other processing flow like program branching, you may use labels
which designate jump destinations. Labels can be omitted if unnecessary.
Labels differ from line numbers used in the general BASIC languages; that is, labels do not
determine the execution order of statements.
You should write a label beginning in the 1st column of a program line. To write a statement
following a label, it is necessary to place one or more separators (spaces or tabs) between the
label and the statement.
As shown below, using a label in the
IF
statement block can eliminate the
GOTO
statement
which should usually precede a jump-destination label.
IF a = 1 THEN Check
ELSE 500
ENDIF
Where the words "Check" and "500" are used as labels.
For detailed information about labels, refer to Section 4.3.
Summary of Contents for BHT-BASIC 100 SERIES
Page 1: ......
Page 161: ...153 Chapter 10 Sleep Function CONTENTS 10 1 Sleep Function 154...
Page 163: ...155 Chapter 11 Resume Function CONTENTS 11 1 Resume Function 156...
Page 173: ...165 Chapter 13 Backlight Function CONTENTS 13 1 Backlight Function 166...
Page 249: ...241 Example CLOSE IF kyIn Y THEN KILL Master Dat END IF Reference Statements CLFILE...