How to exit or not from a while loop?
This is the code:
Global $test
$choice = GUICreate("Custom MsgBox", 225, 80)
GUICtrlCreateLabel("Please select a button.", 10, 10)
Local $idYess = GUICtrlCreateButton("YES", 10, 50, 65, 25)
Local $idNoo = GUICtrlCreateButton("NON", 80, 50, 65, 25)
Local $idExitt = GUICtrlCreateButton("EXIT", 150, 50, 65, 25)
GUISetState(@SW_SHOW, $choice)
Local $iMsgBoxAnswer = 1, $bLoop = True
While $bLoop
Switch GUIGetMsg()
Case $idYess
ConsoleWrite("$idYess=" & $idYess & @CRLF)
Case $idNoo
ConsoleWrite("$idNoo=" & $idNoo & @CRLF)
EndSwitch
If $iMsgBoxAnswer = 1 Then ContinueLoop
$iMsgBoxAnswer = MsgBox(4100, "MsgBox", "Are you sure you want to close the program?", 3)
Select
Case $iMsgBoxAnswer = 6 ;Yes
ConsoleWrite("- bye bye" & @CRLF)
$bLoop = False
EndSelect
WEnd
Global $num = 1
While 1
Switch $num
Case "1"
MsgBox(0, '', 'Number 1')
ExitLoop
EndSwitch
Wend
Why isn't the 2nd working?
And why does it work after have click on exit on first loop?
Is this what you want?