gdgqler wrote:
On 6 Jan 2010, at 17:50, Ralf Reköndt wrote:

gdgqler wrote:
On 6 Jan 2010, at 17:21, gdgqler wrote:


On 6 Jan 2010, at 17:04, Ralf Reköndt wrote:

gdgqler wrote:

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

Just to make it a bit more complete:

Commands

SARRAY name,array                              save an array to a file
SARRAY_O name,array                              SARRAY with overwrite
LARRAY name,array                            load an array from a file
SORT array$                            sort 2-dimensional string array
SORT array$,field             sort 3-dimensional string array by field
SORT_I array$ ,field                                   inverted SORT

Functions

ADIM (name)                    find no. of dimensions of a saved array
ADIMN (name,i)                       find dimension i of a saved array
ATYP (name)                                 find type of a saved array


I see that I have written  in my manual that ADIMN doesn't work unless
the file has at least 64 bytes.

Is this another of my errors? Or was that quirk corrected?

I do not know, I haven't used such a small file ever. Maybe you can find
the bug (if so) in the source code 8-)?


I no longer have, or can't find, which for immediate practical purposes
is the same thing, the source code for TK3 sent to me by Freddy Vaccha.
However, I have a file called TK3_TOOL2_asm which does have code for
ADIMN. This is similar to the code I have for the amended version of TK3
I use personally. The code in TK3_TOOL2_asm has, near the start, after
the file containing the array has been opened, code to read in 64 bytes.
If D0.L is non zero after this then an error is reported. Clearly the EOF
condition will cause an error for all files of length less than 64. This,
I assume, is the error I have mentioned.

Yes, you have got them from me ;-) (Always ask for the "originals"...)

As for TURBO, I think that the real reason that it did not compile the
instructions 18 years ago was due to the fact that at the time TURBO did
not allow array parameters to machine code procedures or functions. TURBO
allows these now. Although string arrays can still not be used as
parameters except under SMSQ/E.

Should be "my fault", as during testing, only QLib was used, although I have a copy of Turbo (but never used it seriously). And I haven't tested all FNs and Procs in compiled conditions ;-).

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

Reply via email to