Nascom Newsletter |
Volume 3 · Number 3 · August 1983 |
| Page 32 of 37 |
|---|
including the file opening commands described above, require additional variable names to specify the data (or filename) to be saved or loaded. There are a number of significant restrictions associated with these names in ROM BASIC. Again you should realise that these are associated with the simple BASIC Routine Handler incorporated within NAS-DOS for use with the ROM BASIC. These restrictions are not inherent in NAS-DOS itself, and the Extended BASIC, XBASIC, for example, incorporates ore sophisticated transfer of data between files and variables which are not subject to these restrictions. The main restrictions are as follows:
1. Only simple character strings may be loaded or saved.
Numbers must be converted using the STR$ and VAL functions
before/
100 FOR I=1 10 20
110 A$= STR$(A(I))
120 A=USR(32),A$
130 NEXT
to save the elements in character string form.
2. While more than one string can be loaded/
These limitations do not affect XBASIC, which allows almost any type of variable to be read or written – see the XBASIC manual for more details on this.
There are essentially two different types of data file which can be saved on disc – at least using NAS-DOS. These are knows as sequential files and random files. We will describe sequential files here and introduce random files. next month we will describe random files in more detail.
Sequential files are very comparable with data written onto magnetic tape. Generally to get any item on the file you must start from the beginning and read (or write) each item in turn until you get to the required point. If you are writing the file you must then write any remaining data. Because the
| Page 32 of 37 |
|---|