Create an uninitialized array of specified length

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


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


     ARRAY() returns an array of specified dimensions.


     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 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.


     .  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.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.