View Full Version : Calling Subroutines Multiple Times
Forkosh
- 13th March 2008, 12:59
Hey Guys,
Right now when I want to call the same subroutine 50 times subsequently I do the following code.
Start:
GOSUB GoForward
x=x+1
IF x>49 THEN
GOSUB Stop
ELSE
GOTO Start
ENDIF
Any easier way to do this?
Thanks,
Eric
Kamikaze47
- 13th March 2008, 13:15
As long as i've interpreted your code correctly, this will do the same thing:
for x=0 to 49
GOSUB GoForward
next x
GOSUB Stop
sayzer
- 17th March 2008, 07:11
<font color="#000000">X = <font color="#FF0000"><b>0
</b></font><font color="#000080"><b>WHILE </b></font>X < <font color="#FF0000"><b>50
</b></font><font color="#000080"><b>GOSUB </b></font>GoForward
X = X + <font color="#FF0000"><b>1
</b></font><font color="#000080"><b>WEND
GOSUB </b></font>SubStop <font color="#000080"><i>' Stop is reserved word, use something else; like SubStop.
</i></font>
Powered by vBulletin® Version 4.1.7 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.