array reference on non-array
Don
Posts: 34
I noticed that if I create a non-array variable, the tokenizer doesn't complain if·I reference it using a subscript.· For example,
I see no mention of this "feature" in the manual.· The manual does mention, however, that the first element of an array may be referenced without using the subscript.· I assume that these are two sides of the same coin.
Also, I see that the set of operators that can be used in constant expressions is fairly limited.· Being able to use SIN or DCD in a constant expression would be handy and would seem to be a fairly trivial extension of the tokenizer code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don Kinzer
·
i VAR Byte ... i(1) = 3
I see no mention of this "feature" in the manual.· The manual does mention, however, that the first element of an array may be referenced without using the subscript.· I assume that these are two sides of the same coin.
Also, I see that the set of operators that can be used in constant expressions is fairly limited.· Being able to use SIN or DCD in a constant expression would be handy and would seem to be a fairly trivial extension of the tokenizer code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don Kinzer
·
Comments
I use this strategy with aliasing to keep my code easy to read. Here's one example:
red···· VAR· Byte
green·· VAR· Byte
blue··· VAR· Byte
colors· VAR· red
idx···· VAR· Nib
Now I can initialize all three colors to any value like this:
FOR idx = 0 TO 2
·· colors(idx) = 0
NEXT
I don't know that we'll ever be able to add functions like SIN and DCD to constant declarations, but I will pass the suggestion on to our Engineering department.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Post Edited (Jon Williams) : 8/9/2004 7:23:41 PM GMT