Home | Reviews | GUIpedia | Forum | Fun500


Geode
That's my new GUI, I need to know how to how to incorporate FOR...NEXT and DO...LOOP. Anyone who will help will get recognition it the About script and the Readme. Sorry I can't send monies. Thanks!
2009-07-315:23 AM

BrandonRe:Geode
Well a do loop I can handle. Basically your scripter should keep track of the position its at in the script? Mine did anyways, and that makes it easy, when you hit a do, record its position, and when you hit a loop go back to that position. For next would be similar, but you'd have 2 more variables to keep track of how many times you've looped and how many you need to.
2009-07-316:29 AM

SonicBritRe:Geode
For Loop is basically a more advanced loop For I = 1 to 10 CODE Next translates to I=1 Do CODE I=I+1 Loop until i=10
2009-07-315:26 PM

ToddRe:Geode
What about nested loops? for a = 1 to 100 for b = 1 to 50 for c = 1 to a+b CODE next c next b next a
2009-07-315:30 PM

ksrRe:Geode
Then you need to keep track of line numbers in a stack. When you get to a for, push the line number onto the stack. When you get to a next, increment all your variables etc., and read the line number of the FOR to jump to from the stack. If the for..next loop is finished then pop from the stack and continue.
2009-07-316:21 PM

Re:Geode
I have stacks and everything sorted out, it's how to loop it. Geode runs Crystal, CSX files are the apps. The programmer can decide to make it a Unitasker or... OK, I don't know how to put ir into english So I'll do this: [code]DO FOR A=0 TO WINDOWLIMIT RUN.APP A 'Executes every command in the file. NEXT LOOP [/code] So it's like any other scripter but it runs every line. Look at it as a unitasking scripter, because it is sorta :blink: . Anyway, I was thinking of how to loop it and i thought of the code inside FOR...NEXT and DO...LOOP inside a temp file, would that work? Tell me if I'm first to make something this crazy :lol:
2009-07-317:50 PM

Re:Geode
Please! I need help :unsure: How would i write a DO...LOOP and FOR...NEXT commands for the unitasking script?
2009-08-018:25 AM

BrandonRe:Geode
You need to track position, as far as line number.
2009-08-019:16 AM

ksrRe:Geode
You mean how do you go backwards in your script? I'm guessing you're using LINE INPUT to get each line. You need to copy the script into an array and then you can move freely through it.
2009-08-019:50 AM

Re:Geode
KSR: Would i get the data inside the loop like: a=0 do input #1,dat$ if ucase$(dat$)="LOOP" then exit do a=a+1 dlfn(fornum,a)=dat$ 'dlfn = do loop for next loop right?
2009-08-0110:31 AM

GUIs


2021 Brandon Cornell