"Incorrect Symbol - W1"

rbwilliams

New Member
Hello,
I am relatively new to Picaxe. So please be patient.

Can anyone explain to me why these lines don't compile with a 28X1 selected?

code/
symbol SYMBOL1 = w1
symbol SYMBOL2 = 65536 - t1s_16
symbol SYMBOL3 = SYMBOL2 / SYMBOL1
symbol SYMBOL4 = 65536 - SYMBOL3
/code

Thanks,
Roger
 

picaxester

Senior Member
Are you using Linux?
Because for some risen it doesn't like the character "0D".
I had to use a hex editor to remove them from the programs that I make using Windows.
 

BCJKiwi

Senior Member
The answer is fairly straight forward - you can't do math in a symbol declaration!

The manual says;
Symbols
Symbols can be assigned to constant values, and can also be used as alias names
for variables (see Variables overleaf for more details). Constant values and
variable names are assigned by following the symbol name with an equal-sign
(=), followed by the variable or constant."

A mathematical expression is not a constant or a variable name.

Well I stand corrected! - Live and Learn as they say!
 
Last edited:

hippy

Technical Support
Staff member
Maths operators can be used within SYMBOL but the issue here is in trying to use a variable (w1) as a constant ...

symbol SYMBOL1 = w1
symbol SYMBOL3 = SYMBOL2 / SYMBOL1
 

westaust55

Moderator
Add to Manual 2

Can this fact that math can be done within a SYMBOL statement be added to Manual 2 at page 6 on the topic "Symbols" in the next revision
 

hippy

Technical Support
Staff member
It's described in manual 2 on Page 173 under SYMBOL command but point noted.
 
Top