
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.
Содержание BHT-BASIC 100 SERIES
Страница 1: ......
Страница 161: ...153 Chapter 10 Sleep Function CONTENTS 10 1 Sleep Function 154...
Страница 163: ...155 Chapter 11 Resume Function CONTENTS 11 1 Resume Function 156...
Страница 173: ...165 Chapter 13 Backlight Function CONTENTS 13 1 Backlight Function 166...
Страница 192: ...Chapter 14 Statement Reference 184 Example OPEN master Dat AS 1 FIELD 1 20 AS bar 10 AS ky CLFILE 1 CLOSE 1...
Страница 249: ...241 Example CLOSE IF kyIn Y THEN KILL Master Dat END IF Reference Statements CLFILE...
Страница 349: ...341 Run time errors Error code Meaning 05h Parameter out of the range checktype is out of the range...
Страница 383: ...375 Run time errors Reference Error code Meaning 05h Parameter out of the range Functions LEFT LEN and RIGHT...