David422 Posted November 7, 2008 Share Posted November 7, 2008 So I'm trying to operate a WHILE 1 statement and ideally it would run 20 times before continuing to another part of the script. First, I don't know how to designate that it occur 20 times, and second I don't know how to tell it to go to another part of the script when 20 cycles have completed. Can anyone help? Link to comment Share on other sites More sharing options...
happyuser Posted November 7, 2008 Share Posted November 7, 2008 (edited) WHILE is not designed to run a sequence 20 times. It is supposed to run a sequence as long as a certain assesment is TRUE. a = 1 WHILE a<10 a = a+1 WEND will run the sequence 9 times then will exit. If you want to execute somethibg 20 times, use FOR i=1 to 20 DO It is design for that. Edited November 7, 2008 by happyuser Link to comment Share on other sites More sharing options...
David422 Posted November 7, 2008 Author Share Posted November 7, 2008 WHILE is not designed to run a sequence 20 times. It is supposed to run a sequence as long as a certain assesment is TRUE.a = 1WHILE a<10 a = a+1WENDwill run the sequence 9 times then will exit.If you want to execute somethibg 20 times, use FOR i=1 to 20 DOIt is design for that.so how would i designate a DO IT statement? Link to comment Share on other sites More sharing options...
Valuater Posted November 7, 2008 Share Posted November 7, 2008 Maybe.... Dim $x While 1 $x = $x + 1 If $x <= 20 Then Do_This() EndIf If $x >= 21 Then Start_This($x) EndIf ; start all over If $x >= 40 Then $x = 0 WEnd ; --- Functions ---- Func Do_This() MsgBox(0x0, $x, " Count is " & $x, 2) EndFunc ;==>Do_This Func Start_This($in) MsgBox(0x0, $in, " Count is " & $in, 2) EndFunc ;==>Start_This 8) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now