Skip to content

Instantly share code, notes, and snippets.

@TLMcode
Created November 9, 2018 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TLMcode/70dc42c4f6219a57905bad43ae48a2c7 to your computer and use it in GitHub Desktop.
Save TLMcode/70dc42c4f6219a57905bad43ae48a2c7 to your computer and use it in GitHub Desktop.
Stop := 0
While ( Stop = 0 ) ; 786, 33 1096, 70 ; << PARAMETER VALUES COMMENTED OUT!!
{
msgbox % "While Loop #1`nStop's value: " ( ( Stop ) ? "true" : "false" )
Stop = 1
; ^^ this evaluates the while expression true
}
msgbox % "After loop exit`nStop's value: " ( ( Stop ) ? "true" : "false" )
; ^^ seeing this proves the while loop evaluated false and broke
msgbox % ( Stop = 0 ) 786, 33 1096, 70 ( 'broken' command parameter, press any button )
; ^^ in most command & function parameters, this will fail.
Stop := 0
While ( Stop = 0 ) 786, 33 1096, 70
{
msgbox % a_index > 1 ? "0x1" : 0,, % "While Loop #2`nStop's value: " ( ( Stop ) ? "true" : "false" ) "`n`nRegardless of Stop's value, the expression is broken so the loop will never exit.`n( watch 'Stop's value' above! )"
IfMsgBox Cancel
break
Stop = 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment