
-----------------------------------
omni
Thu Apr 29, 2004 5:08 pm

resizing first dimension of flexible array
-----------------------------------
I want to be able to change the size of the first dimension of a 2d array

var data:flexible array 0..1,0..3 of int
var count:int:=0
loop
count:=count+1
new data,count
exit when count=10
end loop
This is just an example, but it gives me an error about expected comma.

-----------------------------------
Delos
Thu Apr 29, 2004 6:12 pm


-----------------------------------
You cannot resize the first umm...thing or a multidimensional array.

You would do it like this:


new data, count, count


But that doesn't work.

You could do this:


    new data, count, upper (data, 2)


-----------------------------------
Cervantes
Thu Apr 29, 2004 7:02 pm


-----------------------------------
same general topic here: anyone know how to do flexible arrays in records?  can it be done in this version of turing?

-----------------------------------
Raugrist
Fri Apr 30, 2004 4:46 am


-----------------------------------
I guess not. "Syntax error at flexible"

-----------------------------------
Tony
Fri Apr 30, 2004 6:07 am


-----------------------------------
flexable array inside a record type? :? no... :lol:

-----------------------------------
Delos
Fri Apr 30, 2004 9:25 am


-----------------------------------
You can't make a record of flexible arrays...but on the other hand you could make a flexible array of records!


type test :
record
array 1..4 of int
end record

var anotherTest : flexible array 1..0 of test


And play with that...but that is apparently obvious.

-----------------------------------
Kuntzy
Fri Apr 30, 2004 7:08 pm


-----------------------------------
I've tryed multidymentional flexible arrays before, at least with just 4.00 they don't work ... but at least they say their sorry about it. I haven;t tried with the updates though.
