Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fast loop question
#3
Your code is difficult to read formatted as is.
In Quick Macros, highlight your portion of code, click Edit->Other Formats->Copy for QM Forum

Loops can be nested in QM using proper indentation.
Use the keyword "break" to exit the current loop(if this loop is nested the outer loop will continue to run)
Alternatively you can use the keyword goto to immediately go to a specified label and continue the program from that label

Also, if you want your loop to repeat infinitely, you can leave the # blank (instead of 99999999)



Macro
Code:
Copy      Help
int outercount = 0
int innercount = 0
str output
rep 4 ;;outerloop
,outercount + 1
,output + outercount
,output + ":"
,rep 4  ;;innerloop
,,innercount + 1        
,,output + " "
,,output + innercount
,,if innercount = 6
,,,break
,,if innercount = 11
,,,out output
,,,goto finish
,out output
,output = ""
;finish
out "finished"


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)