06-11-2023, 03:43 AM
(This post was last modified: 06-11-2023, 03:44 AM by TerryRitchie.)
(06-11-2023, 03:10 AM)sivacc Wrote: ReDim and assign an array within a SUB and pass through the SUB's parametersHere is what I believe you are looking for:
.......
getarray z%()
print ubound(z%), z%(5)
end
SUB getarray( x() as integer)
n%= 25
ReDim as ineger x(0 to n%-1)
for p%= 0 to n%-1
x%(p%)= p%*p%
next
end sub
Code: (Select All)
REDIM AS INTEGER x(0)
getarray x()
PRINT UBOUND(x), x(5)
END
SUB getarray (x() AS INTEGER)
n% = 25
REDIM AS INTEGER x(0 TO n% - 1)
FOR p% = 0 TO n% - 1
x(p%) = p% * p%
NEXT
END SUB