[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Fill an array with a specified value

     AFILL(<aTarget>, <expValue>,
        [<nStart>], [<nCount>]) --> aTarget


     <aTarget> is the array to be filled.

     <expValue> is the value to be placed in each array element.  It can
     be an expression of any valid data type.

     <nStart> is the position of the first element to be filled.  If this
     argument is omitted, the default value is one.

     <nCount> is the number of elements to be filled starting with
     element <nStart>.  If this argument is omitted, elements are filled from
     the starting element position to the end of the array.


     AFILL() returns a reference to <aTarget>.


     AFILL() is an array function that fills the specified array with a
     single value of any data type (including an array, code block, or NIL)
     by assigning <expValue> to each array element in the specified range.

     Warning!  AFILL() cannot be used to fill multidimensional arrays.
     CA-Clipper implements multidimensional arrays by nesting arrays within
     other arrays.  Using AFILL() with a multidimensional array will
     overwrite subarrays used for the other dimensions of the array.


     .  This example, creates a three-element array.  The array is
        then filled with the logical value, (.F.).  Finally, elements in
        positions two and three are assigned the new value of true (.T.):

        LOCAL aLogic[3]
        // Result: aLogic is { NIL, NIL, NIL }

        AFILL(aLogic, .F.)
        // Result: aLogic is { .F., .F., .F. }

        AFILL(aLogic, .T., 2, 2)
        // Result: aLogic is { .F., .T., .T. }

 Files   Library is CLIPPER.LIB.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson