Agent420
05-05-2008, 06:27 PM
This wasn't clear in the manual, and a quick search here didn't bring up anything similar...
If I have a long variable array, then want to access the high/low words from that variable, I thought I could do this:
VAR
· long matrix[20]
PUB main | x, y
· x := matrix[1].word[0]
· y := matrix[1].word[1]
But that fails during compilation with an 'Expected end of line' error at the period between matrix[1] and word[0]
I'm guessing you cannot combine the two on one line, as I eventually tried this and it worked:
PUB main | x, y, z
· z := matrix[1]
· x := z.word[0]
· y := z.word[1]
Is this even the best way to assign hi/lo words of a variable?· I was going to AND with a mask, but this seemed cleaner.
Post Edited (Agent420) : 5/5/2008 11:38:56 AM GMT
If I have a long variable array, then want to access the high/low words from that variable, I thought I could do this:
VAR
· long matrix[20]
PUB main | x, y
· x := matrix[1].word[0]
· y := matrix[1].word[1]
But that fails during compilation with an 'Expected end of line' error at the period between matrix[1] and word[0]
I'm guessing you cannot combine the two on one line, as I eventually tried this and it worked:
PUB main | x, y, z
· z := matrix[1]
· x := z.word[0]
· y := z.word[1]
Is this even the best way to assign hi/lo words of a variable?· I was going to AND with a mask, but this seemed cleaner.
Post Edited (Agent420) : 5/5/2008 11:38:56 AM GMT