resize() resizes the given single-dimensional array to the specified size. If the new size is bigger than the previous array size, the elements will be appended to the end of the array. If the new size is smaller, the excessive elements will be deleted from the end of the array and all the data in them will be lost.
This method requires a single argument.
Syntax:
array_variable.resize(size)
Usage example:
DEFINE ar DYNAMIC ARRAY OF INT ... FOR i = 1 TO 10 #the array has 10 elements LET ar[i]=i END FOR CALL ar.resize(100) #the array is resized to 100 elements, 90 of which contain 0 CALL ar.resize(5) #the array is then resized to 5 elements, so values 6, 7, 8, 9, #and 10 are discarded together with 0 values