Author Topic: "Break" action to get out of loops  (Read 215 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1051
  • RTFM
"Break" action to get out of loops
« on: August 08, 2017, 12:34:50 pm »
With the addition of for loops, where using a variable to stop the loop a la
Code: [Select]
Set Boolean [Loop] to True
Start Loop While : [Loop] Equals True
    Begin Text Compare : [Condition] Equals 'true'
        Set Boolean [Loop] to False
    End Condition
End Loop
Is not possible, I would like to request an action to break out of loops directly.

It would be the equivalent of
Code: [Select]
Start Loop While : [{EXP:1=1}] Equals '1'
    Begin Text Compare : [Condition] Equals 'true'
        Jump to Marker: Break
    End Condition
End Loop
Marker: Break
Where the "Break" action would jump to the action below the "End Loop" block, without requiring an additional marker(In the same way the "Jump to a Place in this Command" action can jump directly to the beginning or end of the command, or the "Exit Command" action, which is shorthand for the latter).
« Last Edit: September 17, 2017, 05:13:48 am by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 1261
Re: "Break" action to get out of loops
« Reply #1 on: August 13, 2017, 10:56:14 pm »
Added a new, 'Loop Break' action that will be in the next beta ;)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1051
  • RTFM
Re: "Break" action to get out of loops
« Reply #2 on: August 14, 2017, 12:45:42 am »


Thanks, Gary ;D

EDIT: Added and working in v1.6.7.8
« Last Edit: September 17, 2017, 05:13:41 am by Pfeil »