
-----------------------------------
zhiyuan_wu
Thu Jun 03, 2004 7:17 pm

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]

-----------------------------------
Andy
Thu Jun 03, 2004 8:09 pm


-----------------------------------
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
Fri Jun 04, 2004 11:13 am


-----------------------------------
I.e.

In case 1:
L (hay(#ElementRef).letters)

is what you are missing.

-----------------------------------
Delta
Fri Jun 04, 2004 1:27 pm


-----------------------------------
ya for sure 1st example your missing the (#) after hay

hay(1).letters

Next your 2nd example shouldn't work either... are you sure it does?

It should be something like this when being called

L(hay.letters(1))


unless somehow it really does work :S or I just missed something :S
