Question about code (What am I doing wrong?)
im on a project called Polled_RC_Timer.bs2 in the stamp homework and when I try to test my code it give me this error ![confused.gif](http://forums.parallax.com/images/smilies/confused.gif)
Heres the problem
![messy.PNG](http://d.yimg.com/kq/groups/22888687/or/1548728468/name/messy.PNG)
Heres the original code from the book
![confused.gif](http://forums.parallax.com/images/smilies/confused.gif)
Heres the problem
Heres the original code from the book
![Picture.jpg](http://d.yimg.com/kq/groups/22888687/or/105069067/name/Picture.jpg)
Comments
-Phil
Post Edited (Phil Pilgrim (PhiPi)) : 5/2/2009 7:43:05 AM GMT
Just so you don't think you are crazy... A fresh set of eyes can usually spot a problem more easily. If you can't find someone to help you - get up and go do something else for a while and come back. Usually you can see what is wrong then!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Whit+
"We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
It did not detect / evaluate the assumed label syntax - label ends with ":" and· the "=" should have been evalauted and appropriate·error posted.
I think "undefined variable" would make more sense.
It smells of "bearware". Maybe release 2.7 will correct this.
·
more lookahead than it has to. In this case, the compiler encounters a symbol, looks it up in the symbol
table, and sees that it's not there. Assuming it's something legitimate (giving you, the programmer, the
benefit of the doubt) it says, "Aha! It must be a label!", and proceeds accordingly. Imagine its
disappointment when it sees that there's no semicolon! I guess the point I'm trying to make is that parsing
incorrect code, being almost equivalent to mindreading, is hard. Try not to hold it against the compiler
writers if their code can't read your mind.
-Phil
Addendum: When I was in college studying computer science, the campus computer center provided
a language called "PL/S", a student version of IBM's PL/1. Thinking they were doing the programmer a favor,
the compiler's programmers decided to let it correct programming errors. What a disaster! It never did
it right and ended up gobbling more precious computing seconds than if it had simply reported an error and
aborted.
Post Edited (Phil Pilgrim (PhiPi)) : 5/7/2009 2:35:17 AM GMT