Difference between revisions of "AFILL()"

From Lianjapedia
Jump to: navigation, search
 
Line 27: Line 27:
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
[[Category:Array Processing]]
 
 
[[Category:Array Processing Functions]]
 
[[Category:Array Processing Functions]]

Latest revision as of 09:02, 7 December 2012

Purpose

Function to fill a defined section of an array with an expression

Syntax

AFILL(<array> , <exp> [,<expN1> [,<expN2>]])

See Also

AADD(), AAVERAGE(), ACOPY(), ADEL(), ADESC(), ADIR(), AELEMENT(), AFIELDS(), AINS(), ALEN(), AMAX(), AMIN(), APPEND FROM ARRAY, ARRAY(), ASCAN(), ASIZE(), ASORT(), ASTORE(), ASTRING(), ASUBSCRIPT(), ASUM(), COPY TO ARRAY, DECLARE, DIMENSION, GATHER, IN_ARRAY(), IS_ARRAY(), LOCAL, PRIVATE, PUBLIC, RELEASE, RESTORE, SAVE, SCATTER

Description

The AFILL() function fills the elements of a previously declared <array> with the specified <exp>. The starting element I the array can be specified with <expN1> and the number of elements to fill with <expN2>. If <expN1> is not specified, the fill starts from the first element. If <expN2> is not specified, the fill will continue to the last element. The AFILL() function returns .T. if successful and .F. otherwise. All array elements can also be assigned a value using the = operator.

Example

declare matrix[100]
afill(matrix,"good",51,100)
? matrix[45]
.F.
? matrix[75]
good
? afill(matrix,"bad",1,50)
.T.
? matrix[45]
bad