Repeat 1,2...or 3 times which include conditions.

Ellie

New member
The repeat loop need some modification, especially for example the repeat 2 times [no options for conditions to control this loop].

The thing is , we want to repeat/loop 1, 2 or 3 times but with certain conditions. However the loop option that has the option for these integers has no option to include conditions. Please do something, developer.
 

Abalsam

Active member
You could use if and break from loop
Or you could do an until loop instead, testing for your conditions within the loop and setting the variable to end the loop if the condition is met.

In theory this does what you want and is cleaner code than breaking from loops.

Set break=False
Until variable break=True do:
- perform action
- if condition is met to break loop
- Set break=True
- endif
end loop

This way the loop will run at least once and continue running until your condition is met.

Hope that helps.
 

Ellie

New member
That is a long way. It is good to have that repeat have option to include conditions if we need them. Its much easier that way.
 

Ellie

New member
Or you could do an until loop instead, testing for your conditions within the loop and setting the variable to end the loop if the condition is met.

In theory this does what you want and is cleaner code than breaking from loops.

Set break=False
Until variable break=True do:
- perform action
- if condition is met to break loop
- Set break=True
- endif
end loop

This way the loop will run at least once and continue running until your condition is met.

Hope that helps.
Including variables will make it longer and complex as well. Of coz it can work. However sometimes variables fail to work well.
 

dsnz

Well-known member
he is either talking about

repeat actions -> while condition repeat

and condition is many conditions combined and not just one

which exists already


or he wants a combination of repeat actions
both
- fixed number of iterations
- while condition repeat
whichever comes first

only ... no programming language ever has or will have this combination
and you must choose one setup and program the other, which way you think easier

that's life !
 
Top