On 6 Jan 2010, at 08:43, <[email protected]> wrote:

> Does anyone know of a way of saving data stored in an array on a QL like you 
> can with the ZX Spectrum?  Below is a description of the way it's done on the 
> Spectum using the SAVE command.
> 
> You can save arrays on tape using DATA in a SAVE statement by 
> 
>       SAVE string DATA array name()
> 
> String is the name that the information will have on tape and works in 
> exactly the same way as when you save a program or plain bytes. 
> 
> The array name specifies the array you want to save, so it is just a letter 
> or a letter followed by $. Remember the brackets afterwards; you might think 
> they are logically unnecessary but you still have to put them in to make it 
> easier for the computer. 
> 
> Be clear about the separate roles of string and array name. If you say (for 
> instance) 
> 
> SAVE "Bloggs" DATA b()
> 
> then SAVE takes the array b from the computer and stores it on tape under the 
> name "Bloggs".

In TK3 sold by Digital Precision there are three commands

SARRAY filename,array   saves the array to the file
SARRAY_O is the same as SARRAY but overwrites an original file
LARRAY filename,array     loads an array from the file

The saved arrays have the following header:

Position        Item
0              'ATK3'
4              Array type (as in the BASIC name table so $0301 is a string 
array)
6              Offset to data
8              Number of dimensions
10            Index 1
12            Multiplier 1
14            Index 2
16            Multiplier 2

..               ...

Offset      Start of data


These work in S*BASIC programs but you can't compile them with TURBO.

George
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to