aDestinoArray to resize.
AdvPL GuideASize( <aDestino>, <nTamanho> ) --> NilResizes an existing array.
ASize changes the element count. Shrinking discards final positions and contents; growing does not create complete business records. The consulted page declares a Nil return, so the example calls it as a statement and keeps the array in its original variable. Recheck valid indexes after shrinking. (TOTVS, s.d., ref. 1)
ASize( <aDestino>, <nTamanho> ) --> NilaDestinoArray to resize.
nTamanhoNew length.
Nil according to the consulted page. The effect applies to the supplied array.
#Include "Protheus.ch"
User Function EdAsize()
Local aItems := {10, 20, 30}
// Do not assign the ASize return to aItems.
ASize(aItems, 2)
ConOut(cValToChar(Len(aItems)))
ConOut(cValToChar(aItems[2]))
Return NilExpected results: 2 and 20. Element 30 was discarded. 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.