background image

FILE HANDLING

Experienced programmers may write more sophisticated programs that use

large amounts of data. This data may be stored on a file on the cassette. The

commands to handle data files are explained below.

Files of data can be written to and read from the DATASSETTE™ . These

CANNOT be LOADED like a program, but they can be read by a program. To

communicate with the DATASSETTE™ , use the OPEN command.

OPEN A,B,C,"NAME"

This will OPEN a logical file where NAME identifies the file and:

A Choose a reference number from 1 to 255. If your program uses more

than one file, each file must have its own file number.

B Must be 1 for the DATASSETTE™. This is your device code.

C Specifies whether the program will WRITE to or READ from this file,

coded as follows:

if C = 0 read from tape

C= 1 write to tape with an End-Of-File marker to be written when the file is

CLOSED.

C = 2 write to tape with an End-Of-Tape marker to be written when the file is

CLOSED.

Example: OPEN5,1,1,"TEST"

will OPEN a file named "TEST" with a file number of 5. The program will

WRITE to this file on the cassette.

If a value of 2 is chosen for C and "TEST" is chosen for the name, this will

WRITE on End-Of-Tape marker at the end of the file. If the computer is then

told to read a file which is after the file "TEST", then when the computer has
passed TEST it will respond with: FILE NOT FOUND ERROR and stop. This is

because the file "TEST" tells the computer that the tape has ended —

regardless of whether it has or not — so the computer thinks that there are no

14 more programs on the tape.

Summary of Contents for 1531 Datassette

Page 1: ......

Page 2: ...INTERFERENCE IN A RESIDENTIAL INSTALLATION HOWEVER THERE IS NO GUAR ANTEE THAT INTERFERENCE WILL NOT OCCUR IN A PARTICULAR INSTALLATION IF THIS EQUIPMENT DOES CAUSE INTERFERENCE TO RADIO OR TELEVISIO...

Page 3: ...ce for storing and recalling computer programs on ordinary cassette tapes It can be used for saving programs you have written and want to recall for later use It can also be used to read pre recorded...

Page 4: ...and the DATASSETTE communicate through the cord as well TURN OFF THE COMPUTER BEFORE CONNECTING THE DATASSETTE TO IT ForCOMMODOREcomputerusers The COMMODORE 1531 DATASSETTE was designed for use on th...

Page 5: ......

Page 6: ...hecks which are described below STEP 1 Turn off the computer and plug in the DATASSETTE STEP 2 Ensure that the DATASSETTE motor is off by checking that all of the function keys are up If any are not p...

Page 7: ...button The tape heads should remain in the inactive position and the supply spindle should move rapidly clockwise STEP 7 Press STOP again and then F FWD The tape heads should still remain in the inac...

Page 8: ......

Page 9: ......

Page 10: ......

Page 11: ...ay be used in emergency but is not recommended for long term use NOTE Do not use trichloroethane or any other plastic or rubber solvent 2 Cotton swabs 3 Tape head demagnetizer Unit must have protectiv...

Page 12: ...TTE heads STEP 5 Slowly move demagnetizer up to RECORD PLAY head and around on head surface Rate of motion should be approximately one inch per second during this time STEP 6 Slowly move demagnetizer...

Page 13: ......

Page 14: ...o skip through a tape in order to SAVE a new program at the end of other programs The technique to use is described here When you are ready to store the new program that is in your computer give the c...

Page 15: ...se the counter to find a SAVEd program quickly 1 Make sure your tape is rewound to the beginning 2 Reset the counter to 000 by pressing the black button beside the 3 digit display 3 Note the counter n...

Page 16: ...ecifies whether the program will WRITE to or READ from this file coded as follows if C 0 read from tape C 1 write to tape with an End Of File marker to be written when the file is CLOSED C 2 write to...

Page 17: ...logical file 5 Data will be read from the cassette and assigned to the variable A GET is an alternative to INPUT GET will get one character letter at a time GET can read commas colons etc whereas INPU...

Page 18: ...E 20 INPUT 1 D 30 PRINT D 40 IFST OGOT020 50 CLOSE 1 Line 10 OPENS the file for READ as TEST FILE Line 20 Reads a string from the tape into D Line 30 Prints the value of D on the screen Line 40 Checks...

Page 19: ...MS If you are experiencing problems with your DATASSETTE either mechanically or electronically return it to the dealer from whom it was purchased If the DATASSETTE is faulty and in warranty he will re...

Page 20: ......

Reviews: