Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- ClipOn 3.0 Reference - c_readarr() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 C_READARR()

 DESCRIPTION

 C_READARR() restores a specified Clipper array from a disk file
 that was previously saved with the C_WRITEARR() function.  The
 array can be any size valid for Clipper arrays and can contain any
 data types, except memo and array types.

 SYNTAX

 C_READARR(file [,array_name] [,network])

 PARAMETERS

 file (C) is the full name of the DOS disk file to read the array.
 The file name can contain a drive and path specifier, if needed.

 array_name (C) is the name of the Clipper array to restore.  The
 array_name argument must be the name of the array passed in quotes.
 The array must be already declared to the correct size.  If
 array_name is not specified, the number of elements stored in the
 given file is returned.

 network (L) indicates whether or not the program is running on a
 network.  If the program is running on a network pass true (.T.) so
 the file can be opened with the proper share access, otherwise pass
 false (.F.).  If network is not specified, the default of false (.F.)
 is used.

 RETURNS

 C_READARR() returns the number of elements stored in the disk file,
 if the array_name argument is not specified.  If array_name is
 specified, C_READARR() returns the number of elements restored from
 the disk file to the array.

 EXAMPLES

 declare a1[3]                    && Declare and initialize array
 a1[1] = "text string"
 a1[2] = ctod("01/01/90")
 a1[3] = 123.78

 c_writearr("ARR1.FIL", a1)         && Save array to disk file
 ...
 arr_size = c_readarr("ARR1.FIL")   && Read the array size from file

 declare a2[arr_size]        && Declare array to correct size

 if c_readarr("ARR1.FIL", a2) != arr_size     && Restore array
   ? "Error reading array"
   return
 endif

 ? a2[1] --> text string        && Display array contents
 ? a2[2] --> 01/01/90
 ? a2[3] --> 123.78


See Also: C_WRITEARR() C_ATOCHAR() C_CHARTOA()

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