Argox PA-20 Basic Programming Manual User Manual

Page 21

Advertising
background image

PT-Basic Programming Manual Ver. 1.00

20/143

SubName is the line label of a subroutine.

ON … GOTO …

Purpose: To branch to one of several specified Line Labels depending

on the value of an expression.

Syntax: ON N% GOTO LineLabel | LineNumber {,LineLabel |

LineNumber}

Example: D% = DAY_OF_WEEK

ON D% GOTO 1, 2, 3, 4, 5, 6, 7

1

PRINT "MONDAY"

END

2

PRINT "TUESDAY"

END

3

PRINT "WEDNESDAY"

END

4

PRINT "THURSDAY"

END

5

PRINT "FRIDAY"

END

6

PRINT "SATURDAY"

END

7

PRINT "SUNDAY"

END

Description: N% is a numeric expression which is rounded to an

integer.The value of N% determines which line lable in the

list will be used for branching. If the value N% is 0 or greater

than the number of line labels listed,the interpreter will

continue with the next executable statement.

LineLabel is the string label of a program line.

LineNumber is the integer number in front of a program line.

Advertising