Author |
Message |
omni

|
Posted: Thu Apr 29, 2004 5:08 pm Post subject: 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. |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Delos

|
Posted: Thu Apr 29, 2004 6:12 pm Post subject: (No subject) |
|
|
You cannot resize the first umm...thing or a multidimensional array.
You would do it like this:
code: |
new data, count, count
|
But that doesn't work.
You could do this:
code: |
new data, count, upper (data, 2)
|
|
|
|
|
|
 |
Cervantes

|
Posted: Thu Apr 29, 2004 7:02 pm Post subject: (No subject) |
|
|
same general topic here: anyone know how to do flexible arrays in records? can it be done in this version of turing? |
|
|
|
|
 |
Raugrist

|
Posted: Fri Apr 30, 2004 4:46 am Post subject: (No subject) |
|
|
I guess not. "Syntax error at flexible" |
|
|
|
|
 |
Tony

|
|
|
|
 |
Delos

|
Posted: Fri Apr 30, 2004 9:25 am Post subject: (No subject) |
|
|
You can't make a record of flexible arrays...but on the other hand you could make a flexible array of records!
code: |
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

|
Posted: Fri Apr 30, 2004 7:08 pm Post subject: (No subject) |
|
|
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. |
|
|
|
|
 |
|