Alright all you PBASIC Gods out there: here’s a few stumpers for you! I’m in the middle of re-doing the expression evaluator (read: deleting and starting over) for RoboEmu 2.0 and need some help with a few of the more archaic, odd, and downright nutty things you can do with PBASIC.
Without further ado, here they are:
-
What do equalities actually evaluate to? I ask because things such as “if ((5>3)=3)=1<2 …” are actually valid syntax. However, figuring out the value of this depends on what things like (5<3) actually evaluate to. Is it 1? Undefined? Variable based on the situation? Also, are these left-to-right or right-to-left?
-
What does the keyword AND/OR/XOR actually do? Similar to the above example, “if 3 AND 4 …” is valid. I assume PBASIC will evaluate this to true as both 3 and 4 are non-zero, but can anyone confirm this?
-
How long can labels, variables, etc be? I believe it’s 32 characters, but can anyone confirm/deny?
-
Not really a question, but more of a confirmation thing. Here’s the order of operations I’ve come up with. Is this right?
top: AND, OR, XOR
next: =, <>, etc
next: ~, SIN, etc
last: +, -, etc -
Anyone have any other obscure features you’d like to make sure RoboEmu supports?
Thanks in advance for all your help!
–Rob