Home   Help Search Login Register  

Author Topic: Stop looping.  (Read 566 times)

0 Members and 1 Guest are viewing this topic.

Knut Erik

  • Guest
Stop looping.
« on: 09 Mar 2003, 11:02:39 »
Hi folks! I've searched all the forums before posting this.


How do you get a loop to stop after running let us say 4 times?


:P :P :P

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Stop looping.
« Reply #1 on: 09 Mar 2003, 11:03:45 »
wrong board... but IÂ'll help ya anyway.

Copy/paste it 4 times ;)

Dark Nova

  • Guest
Re:Stop looping.
« Reply #2 on: 09 Mar 2003, 11:58:40 »
heres what i use, a 3 stage loop

this will exit after the timeout number is reached

#main

_timeloop = 0
_timeout = 4

#mainloop

_timeloop = _timeloop + 1
? _timeloop > _timeout : Goto "exit"

goto "mainloop"

#exit

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:Stop looping.
« Reply #3 on: 09 Mar 2003, 12:01:27 »
heres what i use, a 3 stage loop

this will exit after the timeout number is reached

#main

_timeloop = 0
_timeout = 4

#mainloop

_timeloop = _timeloop + 1
? _timeloop > _timeout : Goto "exit"

goto "mainloop"

#exit

hey! Why havenÂ't anyone told me about that!?

*Runs to the editors depot to change armstrongs_suiciders*

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Stop looping.
« Reply #4 on: 09 Mar 2003, 12:23:05 »
In fact you can make it even simpler


_timeloop = 0

#mainloop

_timeloop = _timeloop + 1
? _timeloop ==3: exit

goto "mainloop"
Plenty of reviewed ArmA missions for you to play

Dark Nova

  • Guest
Re:Stop looping.
« Reply #5 on: 09 Mar 2003, 13:21:45 »
the reason i use a 3 part loop is for multiple looping.
so if u use goto "main" somewhere else in ya script, the values are reset every time,  and u can use the same exact code for all loops



Knut Erik

  • Guest
Re:Stop looping.
« Reply #6 on: 10 Mar 2003, 08:48:12 »
Thanks a lot people!
You solved my problem  ;D