Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . The Guide To CA-Clippe - <b>array()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ARRAY()
 Create an uninitialized array of specified length
------------------------------------------------------------------------------
 Syntax

     ARRAY(<nElements> [, <nElements>...]) --> aArray

 Arguments

     <nElements> is the number of elements in the specified dimension.
     The maximum number of elements in a dimension is 4096.  Arrays in
     CA-Clipper can have an unlimited number of dimensions.

 Returns

     ARRAY() returns an array of specified dimensions.

 Description

     ARRAY() is an array function that returns an uninitialized array with
     the specified number of elements and dimensions.  If more than one
     <nElements> argument is specified, a multidimensional array is created
     with the number of dimensions equal to the number of <nElements>
     arguments specified.  Any <nElements> that is itself an array creates a
     nested array.

     In CA-Clipper, there are several ways to create an array.  You can
     declare an array using a declaration statement such as LOCAL or STATIC;
     you can create an array using a PRIVATE or PUBLIC statement; you can
     assign a literal array to an existing variable; or you can use the
     ARRAY() function.  ARRAY() has the advantage that it can create arrays
     within expressions or code blocks.

 Examples

     .  This example creates a one-dimensional array of five elements
        using the ARRAY() function, and then shows the equivalent action by
        assigning a literal array of NIL values:

        aArray := ARRAY(5)
        aArray := { NIL, NIL, NIL, NIL, NIL }

     .  This example shows three different statements which create the
        same multidimensional array:

        aArray := ARRAY(3, 2)
        aArray := { {NIL, NIL}, {NIL, NIL}, {NIL, NIL} }
        aArray := { ARRAY(2), ARRAY(2), ARRAY(2) }

     .  This example creates a nested, multidimensional array:

        aArray := ARRAY(3, {NIL,NIL})

 Files:  Library is CLIPPER.LIB.

See Also: AADD() ADEL() AFILL() AINS() LOCAL PUBLIC STATIC

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