8 File Storage

Storing and Retrieving Arrays

Entire arrays can be stored and retrieved by using the array identifier in PRINT# and READ# statements. The syntax for each statement, using direct access, is as follows:

PRINT# file number [,record number] ;array name(*) [,array name(*)][,END]

READ# file number [,record number] ;array name(*) [,array name(*)]

Arrays are stored and retrieved element by element without regard to dimensionality.

For example:

10   OPTION BASE 1
20   PRINTER IS 0
30   DIM A(3),B(3),C(6)
40   A(1)=A(2)=A(3)=65
50   B(1)=B(2)=B(3)=66
60   ASSIGN #1 TO "TEN"
70   PRINT #1,1;A(*),B(*)
80   READ #1,1;C(*)
90   PRINT C(*);
100  END

     65   65   65   66   66   66
Also refer to the MAT PRINT# and MAT READ# statements, covered in page 297 .


Eloquence Language Manual - 19 DEC 2002