To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 21639
21638  |  21640
Subject: 
Re: Are there GOTO statements in NQC?
Newsgroups: 
lugnet.robotics
Date: 
Thu, 20 Nov 2003 14:27:30 GMT
Viewed: 
913 times
  
In lugnet.robotics, Vadim Iosifovich Vaynerman <dimav@Glue.umd.edu> wrote:
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,

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 program should jump
to. For example, this is how an infinite loop that increments a variable could
be implemented using goto:

my_loop:
  x++;
  goto my_loop;

Can you give us a better idea why you think you need a goto statement in your
program?  Perhaps we can help you come up with an alternative?

John Hansen



Message is in Reply To:
  Are there GOTO statements in NQC?
 
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 (...) (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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR