Subject:
|
Are there GOTO statements in NQC?
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Thu, 20 Nov 2003 05:08:06 GMT
|
Original-From:
|
Vadim Iosifovich Vaynerman <dimav@SAYNOTOSPAMglue.umd.edu>
|
Viewed:
|
896 times
|
| |
| |
Hello all,
I REALLY need to use a goto statement in the NQC programming project I'm
doing for the RCX. Dows anybody know if such a statement extsts, and if
so, what the syntax is? I know gotos are bad programming practice, but its
really hard to make a workaround here. All ideas are appreciated.
Thanks,
-Vadim
|
|
Message has 6 Replies: | | Re: Are there GOTO statements in NQC?
|
| (...) Quoting from the NQC Guide: The goto statement forces a program to jump to the specified location. Statements in a program can be labeled by preceding them with an identifier and a colon. A goto statement then specifies the label which the (...) (21 years ago, 20-Nov-03, to lugnet.robotics)
| | | Re: Are there GOTO statements in NQC?
|
| (...) No, NQC does not support goto. I at one point started to add goto to the language, but abandoned the effort when I installed legOS on my brick. It's not really all that hard to add goto to the NQC language; it's a couple minor changes to the (...) (21 years ago, 20-Nov-03, to lugnet.robotics)
| | | Re: Are there GOTO statements in NQC?
|
| (...) Y'know, I really ought to check the latest version before saying these sorts of things. It appears that goto has actually been implemented since the last time I fiddled with NQC. Sorry for the misinformation. - Alex (21 years ago, 20-Nov-03, to lugnet.robotics)
| | | Re: Are there GOTO statements in NQC?
|
| (...) I'm probably in the minority here, but I'm going to come right out and say that goto's are not a bad thing, contrary to popular belief. In fact, I find it rather pompous when I come across admonishments in textbooks that there is no valid (...) (21 years ago, 20-Nov-03, to lugnet.robotics)
| | | Re: Are there GOTO statements in NQC?
|
| (...) Well, you'll hear people telling you: 1) Use the GOTO - it's fine. 2) Use it sparingly - it's dubious. 3) Use it only if you are totally stuck. 4) Never, ever use it - it is the work of Satan. I fall into group (4). I've been working as a (...) (21 years ago, 20-Nov-03, to lugnet.robotics)
|
19 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|