Home › Forums › General discussions › Array Parameter › Reply To: Array Parameter
November 7, 2016 at 10:49
#2836
Keymaster
Try it with the following paramscript, where “size1” and “size2” are the array size parameters and “myArray” is the array with changeable size:
values "size1" range [1,)
values "size2" range [1,)
if GLOB_MODPAR_NAME = "size1" or GLOB_MODPAR_NAME = "size2" then
dim _tempArray [][]
_tempArray = myArray
dim myArray [][]
for ii = 1 to size1
for jj = 1 to size2
if ii > vardim1(_tempArray) or jj > vardim2 (_tempArray) then
_value = 0
else
_value = _tempArray[ii][jj]
endif
myArray[ii][jj] = _value
next jj
next ii
parameters myArray = myArray
endif
Gergely Fehér
Team Leader, Library Team
GRAPHISOFT SE