Author |
Message |
zhiyuan_wu
|
Posted: Thu Jun 03, 2004 7:17 pm Post subject: arrays of a type |
|
|
This is strange how turing cannot recongize an array in a situation like this:
[/code]
proc L (abj : array 1 .. * of int)
end L
type abc :
record
letters :int
end record
var hay : array 1..3 of abc
L (hay.letters)
[code]
Here, turing would give a message: hay cannot be followed by a "."
But in this situation, it is perfectly legal:
[code]
proc L (abj : array 1 .. * of int)
end L
type abc :
record
letters : array 1..3 of int
end record
var hay : abc
L (hay.letters)
Is there a special syntax for it? Or the only way to send in an array like this is to dump the array into another newly made array?
[/code] |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Andy
|
Posted: Thu Jun 03, 2004 8:09 pm Post subject: (No subject) |
|
|
in the first example, hays is declared as an array of type which means you cant access the member variables of the structure as an array. just create a temporary array and dump the stuff you need into that then use it for the parameter |
|
|
|
|
|
Delos
|
Posted: Fri Jun 04, 2004 11:13 am Post subject: (No subject) |
|
|
I.e.
In case 1:
L (hay(#ElementRef).letters)
is what you are missing. |
|
|
|
|
|
Delta
|
Posted: Fri Jun 04, 2004 1:27 pm Post subject: (No subject) |
|
|
ya for sure 1st example your missing the (#) after hay
Next your 2nd example shouldn't work either... are you sure it does?
It should be something like this when being called
unless somehow it really does work :S or I just missed something :S |
|
|
|
|
|
|