>> It really matters what flavor you're running.
>
>Which nobody has explained :-)

Basic Ref for MATREAD says:

"If the number of elements in array is greater than the number of fields
in the
record, the extra elements in array are assigned empty string values. If
thenumber of fields in the record is greater than the number of elements
in the
array, the extra values are stored in the zero element of array for
IDEAL or
INFORMATION flavor accounts, or in the last element of array for PICK,
IN2,
or REALITY flavor accounts."


For MATWRITE it says:

"In IDEAL and INFORMATION flavor accounts, if the zero element of the
array has been assigned a value by a MATREAD or MATREADU statement,
the zero element value is written to the record as the n+1 field, where
n is the
number of elements dimensioned in the array. If the zero element is
assigned
an empty string, only the assigned elements of the array are written to
the
record; trailing empty fields are ignored. The new record is written to
the file
(replacing any existing record) without regard for the size of the
array."


You can force one behavior or the other by using 
   $OPTIONS  STATIC.DIM   (Pick  behavior)
   $OPTIONS -STATIC.DIM   (Ideal behavior)
in your program.

( To really screw up the poor programmer who maintans your code, you can
switch between those 2 options multiple times through your program,
treating some arrays one way, some another. )


And just to nitpick again, "n+1" in the MATWRITE text above is a bit
misleading or wrong. Any given array element can be multi-ATTRIBUTEd,
and that means that many attributes are inserted in the middle of the
record being written.

Example (any flavor):

>CT CDS.BP M

     M
0001       OPEN "","VOC" TO F.VOC ELSE STOP 3000,"VOC"
0002       DIM REC(10)
0003       REC(1) = 1
0004       REC(2) = 2
0005       REC(2)<2> = 'B'
0006       REC(2)<3> = 'C'
0007       REC(3) = 'this aint <3>'
0008       MATWRITE REC TO F.VOC, 'CDS'

>RUN CDS.BP M

>CT VOC CDS
     CDS
0001 1
0002 2
0003 B
0004 C
0005 this aint <3>
>


Have we run this to ground yet?  I don't even remember the original
question.
cds
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to