
-----------------------------------
AzureFire
Wed Nov 30, 2005 6:00 pm

Assigning Arrays
-----------------------------------
Is there a way to set every value of an array all at once? 
I need to set them all to false, so after a condition is met, they can be set to true.

-----------------------------------
MysticVegeta
Wed Nov 30, 2005 6:03 pm


-----------------------------------
for x : 1..upper(arr)
arr(x) := false
end for

-----------------------------------
Cervantes
Wed Nov 30, 2005 6:09 pm


-----------------------------------
Also, look into init.


var my_array : 1 .. 5 of int := init (3, 7, 42, 8, 4)


-----------------------------------
AzureFire
Wed Nov 30, 2005 6:13 pm


-----------------------------------
thanks, that was nice and fast :)

-----------------------------------
wtd
Thu Dec 01, 2005 2:13 pm


-----------------------------------
let my_array = Array.init 5 (fun _ -> false)

Oh, right, Turing.  ;)
