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 - arrrest(<c filename>, [<array name>]) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ARRREST(<C filename>, [<array name>])
 Restores a one-dimensional array from a disk file.
 Returns <expL> true if restored properly, otherwise false.

 Default file extension is .ARR

    <numeric | logical> = ARRREST(<C filname>, [<array name>])
    One parameter returns the number of elements in an array file.
    Two parameters return the number of elements restored.
    Any error returns -1.

 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

 It is NOT an error to have less or more elements in the array being
 restored.  If there are less elements in the array than in the file,
 the file's excess are ignored.  If there are more elements in the
 array than in the file, the excess elements are not changed.


             Placed in the Public Domain by Tom Rettig Assoc.

See Also: ARRSAVE()

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