nElementos1First dimension length.
AdvPL GuideArray( <nElementos1>, [xElemento2], ... [xElemento16] ) --> aRetCreates an array with specified dimensions.
Array reserves the requested element count. Additional numeric arguments create dimensions; the page allows up to 16 arguments and states that only the last can be nonnumeric for initialization. A literal can be clearer when starting with known values. Dimensions describe available slots rather than populated records. (TOTVS, s.d., ref. 1)
Array( <nElementos1>, [xElemento2], ... [xElemento16] ) --> aRetnElementos1First dimension length.
xElemento2 ... xElemento16Additional dimensions or final initializer under the documented rules.
Array with the specified structure.
#Include "Protheus.ch"
User Function EdArray()
Local aGrid := Array(2, 2)
// Assign existing cells; do not assume populated records.
aGrid[1][1] := "A"
aGrid[1][2] := 10
ConOut(cValToChar(Len(aGrid)))
ConOut(cValToChar(aGrid[1][2]))
Return NilExpected results: 2 and 10. The second row is not a populated record yet. 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.