Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Tom Rettigs Library - arrsave(<c filename>, <array name>) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ARRSAVE(<C filename>, <array name>)
 Saves a one-dimensional array to a disk file.
 Returns <expL> true if written properly to disk, otherwise false.

 Default file extension is .ARR

 IF .NOT. ARRSAVE( "Arrfile", "oldarray" )
    ? "Error -- file was not written."
 ENDIF

 Note that the filename is passed as a character expression and the
 array name is passed as a literal.  For example:

    * Saving.
    DECLARE my_array[100]
    .
    . <fill array>
    .
    IF .NOT. ARRSAVE("arrays.arr", my_array)
       ? "Error saving array to file."
    ENDIF

    * Restoring.
    elements = ARRREST("arrays.arr")
    IF elements = -1
       ? "Error restoring from array file."
    ELSE
       DECLARE my_array[elements]
       IF elements # ARRREST("arrays.arr", my_array)
          ? "Error in number of elements restored."
       ENDIF
    ENDIF


             Placed in the Public Domain by Tom Rettig Assoc.

See Also: ARRREST()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson