Computer Science Canada

Flexible arrays

Author:  AsianSensation [ Mon May 19, 2003 3:08 pm ]
Post subject:  Flexible arrays

could anyone teach me how to use flexible arrays? the manual didn't help that much. thx

Author:  AsianSensation [ Mon May 19, 2003 3:10 pm ]
Post subject: 

oh, btw, I know it's off the topic, but can anyone also teach me how to use records? I don't know how to use it, never learned it in class.

Author:  Catalyst [ Mon May 19, 2003 3:10 pm ]
Post subject: 

they work just like normal arrays but you can resize them

for example

code:

var test:flexible array 1..1 of int


then to resize it do
code:

new test,10


the upper bound will be changed to ,in this case, 10

Author:  AsianSensation [ Mon May 19, 2003 3:20 pm ]
Post subject: 

can you change the lower bound too?

Author:  Catalyst [ Mon May 19, 2003 3:22 pm ]
Post subject: 

i dont think so

Author:  AsianSensation [ Tue May 20, 2003 4:00 pm ]
Post subject: 

cool, thanks for the help Catalyst.

Author:  Martin [ Tue May 20, 2003 10:21 pm ]
Post subject: 

It'd probably be better to use linked lists, that way you don't need to worry about unused array slots.


: