Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 resizing first dimension of flexible array
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
omni




PostPosted: 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
Sponsor
sponsor
Delos




PostPosted: 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




PostPosted: 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




PostPosted: Fri Apr 30, 2004 4:46 am   Post subject: (No subject)

I guess not. "Syntax error at flexible"
Tony




PostPosted: Fri Apr 30, 2004 6:07 am   Post subject: (No subject)

flexable array inside a record type? Confused no... Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Delos




PostPosted: 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




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: