aDestSized array.
AdvPL GuideAFill( <aDest>, <xValue>, [nStart], [nCount] ) --> aRetFills a range with one value.
AFill modifies existing elements and does not size the array. Without explicit bounds it fills from position 1 through the end. Any value type is accepted, but array or object values do not establish independent copies per slot. Prefer scalar initialization when it fits the data model. (TOTVS, s.d., ref. 1)
AFill( <aDest>, <xValue>, [nStart], [nCount] ) --> aRetaDestSized array.
xValueFill value.
nStartFirst position; default 1.
nCountCount from the starting position; defaults through the end.
Array after filling.
#Include "Protheus.ch"
User Function EdAfill()
Local aValues := Array(4)
// Size first; fill only the required range.
AFill(aValues, 0)
AFill(aValues, 9, 2, 2)
ConOut(cValToChar(aValues[1]))
ConOut(cValToChar(aValues[2]))
Return NilExpected array: {0, 9, 9, 0}; outputs 0 and 9. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.