Function AFill() Foundation
Fills elements in an array with a single value.
AFill( <aArray>, [<Expression>], [<nStart>], [<nCount>] ) --> aArray
The return value of AFill() is a reference to <aArray>.
The array function AFill() fills an array with a single value. The value can be of any data type. If the value is an object or an array, all the elements of the filled array contain the same reference to the object or subarray. The function assigns the value only to the elements of the first dimension. Multidimensional arrays cannot be filled with AFill().
// In the example, two calls to AFill() are shown. The
// first example, where the starting position is passed, only
// fills two elements. The second call assigns a value to
// all elements of the array.
PROCEDURE Main
LOCAL aArray[5] // aArray is: {NIL,NIL,NIL,NIL,NIL}
AFill( aArray,.T., 3, 2 ) // aArray is: {NIL,NIL,.T.,.T.,NIL}
AFill( aArray,.F.) // aArray is: {.F.,.F.,.F.,.F.,.F.}
AFill( aArray ) // aArray is: {NIL,NIL,NIL,NIL,NIL}
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.