News:

Please note new Forum URL: forum.designcad.com

Main Menu

NOP, "no operation"

Started by Flrn, July 20, 2018, 09:58:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Flrn

Does the language include some equivalent of "NOP," which might be used in a one-line:

                         IF (condition) THEN NOP     'no operation?

While not essential, such a structure might be less wasteful of running time.

Have looked at DT's excellent/helpful, "BasicCAD V17 Reference Manual" and 'exhausted' my guesses as to what such a feature might be called.

Thanks,
Jim

Rob S

Would that not be accomplished by either directing the macro to proceed to the next step, or to end as the case may be?
User since forever

Lar

#2
There is an "exit for" to get out of a for/next loop if some condition is met before the full count...

for a=b to c
do some stuff
if a equals some value then exit for
next
(only the underlined is legitimate code)

Similarly, there is an "exit do" for "do while/loop".




When I don't want to exit the loop but just want to skip an iteration I use my "goto NEX/NEX:" (this is similar to what Rob is talking in his post above)


for a=b to c
do some stuff
if a equals some value then goto NEX
do some stuff
NEX:
next

Rob's "End" example:

for a=b to c
do some stuff
if a equals some value then END   'this would terminate the entire macro...
do some stuff
next



Lar

Flrn

Thank you, gentlemen.  Looks like either method would do quite well.

Jim