BS1: PIN5 = PIN5 syntax error
Woodwise
Posts: 6
Following the example in the manual, I programmed
NoClockEvent:
PIN5 = PIN5
TOGGLE 5
But the editor flags this with an error msg:
"Expected an operator"
Huh? It's just an assignment, isn't it?
~Rich
NoClockEvent:
PIN5 = PIN5
TOGGLE 5
But the editor flags this with an error msg:
"Expected an operator"
Huh? It's just an assignment, isn't it?
~Rich
Comments
TempWork = PIN5
PIN5 = TempWork
TOGGLE 5
which also passes. Still, it uses a variable, and what I did at first is in the book. Maybe PBasic can't really do the assignment, so they have changed the syntax checker to accomodate that...
...but
TempWork = TempWork
doesn't work!! So it looks like you are correct, though why the syntax checker cares, I dunno...and I now wonder if I really need PIN5 = PIN5 as the book and the Help both say...
~Rich
[noparse][[/noparse] A = A ...what a concept. ]
YIKES!!!
Please do me a favor in the future. When you post something like this:
quote
Following the example in the manual, I programmed
NoClockEvent:
PIN5 = PIN5
TOGGLE 5
end quote
PLEASE say something like this:
Following a technique I found in the PBASIC Manual, which I modified somewhat, blah blah blah.
Although there IS such an example in the PBASIC Manual, there is no way one can ferret it out by using what you indicated. The (nearly) verbatim example is as follows:
PIN2 = PIN2 ' make output driver match input
TOGGLE 2 ' then toggle
Just as a sidenote that is a BS-1 ONLY example. The BS-2 example follows it. Additionally, I AGREE that the PBASIC Manual indicates that it should work on a BS-1. According to my brief testing, it does NOT, as you found out. The sample example is found here - REF: "PBASIC Stamp Syntax and Reference Manual 2.2", actual PDF page 460, indicated page 456.
Am I just being picky about semantics? You tell me - I just spent almost an hour searching ALL of the Parallax Manuals in PDF form (and I have hundreds of them - old and new) looking for that example. I came up dry! Then it dawned on me that you might have modified the example, and it only took 30 more SECONDS from that point.
Thanks for helping us out, who are willing to help you
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Post Edited (Bruce Bates) : 7/13/2006 7:15:20 PM GMT