Commodore 128 Programmer's Reference Manual page 63

Hide thumbs Also See for 128:
Table of Contents

Advertisement

n
BASIC BUILDING BLOCKS AND BASIC 7.0 ENCYCLOPEDIA
53
/ i
n
ON
Conditionally branch to a specified program line number according to the results of the
specified expression
ON expression <GOTO/GOSUB> line #1 [, line #2, . . .]
EXAMPLE:
10 INPUT X:IF X<0 THEN 10
20 ON X GOTO 30, 40, 50, 60
When X = 1, ON sends control to the first line
25 STOP
number in the list (30). When X = 2, ON sends
30 PRINT "X = 1"
control to the second line (40), etc.
40 PRINT "X = 2"
50 PRINT "X = 3"
60 PRINT "X = 4"
OPEN
Open files for input or output
OPEN logical file number, device number [secondary address] [<,"filename
[,filetype[, [mode"]]|<,cmd string>]
EXAMPLES:
10 OPEN 3,3
20 OPEN 1,0
30 OPEN 1,1,0,"DOT"
OPEN 4,4
OPEN 15,8,15
5 OPEN 8,8,12,"TESTFILE,S,W"
OPEN the screen as file number
3.
OPEN the keyboard as file num
ber 1.
OPEN the cassette for reading, as
file number 1, using "DOT" as
the filename.
OPEN the printer as file number 4.
OPEN the command channel on
the disk as file 15, with secondary
address 15. Secondary address 15
is reserved for the disk drive error
channel.
OPEN a sequential disk file for
writing called TESTFILE as file
number 8, with secondary address
12.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents