Commodore 128 Programmer's Reference Manual page 50

Hide thumbs Also See for 128:
Table of Contents

Advertisement

40
COMMODORE 128
L = Record Length = the length of records in a relative file only
W = Write Operation (if not specified a read operation occurs)
EXAMPLES:
DOPEN#1, "ADDRESS",W
Create the sequential file number 1 (ADDRESS)
for a write operation
DOPEN#2 "RECIPES",D1,U9
Open the sequential file number 2 (RECIPES)
for a read operation on device number 9, drive 1
u
EXAMPLES:
U
10 X = 25
This example performs the statements X = X-l
20 DO UNTIL X = 0
andPRINT"X = ";XuntilX =0. WhenX = Othe
I
30 X = X-l
program resumes with the PRINT "End of Loop"
'-'
40 PRINT ' 'X = " ;X
statement immediately following LOOP.
50 LOOP
j j
60 PRINT "End of Loop"
U
10 DO WHILE A$<> CHR$ (13):GETKEY A$:PRINT A$:LOOP
20 PRINT "THE RETURN KEY HAS BEEN PRESSED"
| I
This DO loop waits for a key to be pressed,
U
receives input from the keyboard one character at
a time and prints the letter of the key which is
< |
pressed. If the RETURN key is pressed, control is
M
transferred out of the loop and line 20 is executed.
10DOPEN#8, "SEQFILE"
This program opens file "SEQFILE" and gets
j j
20 DO
data until the ST system variable indicates all data
|J
30 GET #8,A$
is input.
40 PRINT A$;
50 LOOP UNTIL ST
I
60 DCLOSE #8
U
DOPEN
N
Open a disk file for a read and/or write operation
DOPEN # logical file number/Tilename[,<type>]"[,Lrecord length]
1 j
[,Ddrive number][<ON|,>Udevice number][,W]
U
where type is:
S = Sequential File Type
y
P = Program File Type
U = User File Type
R = Relative File Type
j
u

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents