
-----------------------------------
mike200015
Fri Feb 25, 2005 10:12 pm

Flexible Array Help
-----------------------------------
I have a flexible array of int, Can you set all of the vars with in the array to (0) at the begining, and when a new upper bound is added, that will be set to zero, but not reset all vars to zero :?:

-----------------------------------
AsianSensation
Fri Feb 25, 2005 10:36 pm


-----------------------------------
just keep track of the size of your old array, I think by using upper?

var num : flexible array 1 .. 5 of int
var oldSize : int

for rep : 1 .. upper (num)
    num (rep) := 0
end for

oldSize := upper (num)

new num, 25

for rep : oldSize .. upper (num)
    num (rep) := 0
end for

