[R] Switch et variable
Posté : lun. 02 juil. 2018 13:01
Bonjour,
Désolé pour le titre peu explicite.
Dans l'aide GUI Reference - MessageLoop Mode, l'exemple contient :
Est-ce que ce code est aussi performant ?
ou le problème vient-il du fait que GUIGetMsg() est testé à chaque Case et il vaut donc mieux utiliser la variable $iMsg ?
Désolé pour le titre peu explicite.
Dans l'aide GUI Reference - MessageLoop Mode, l'exemple contient :
Code : Tout sélectionner
Local $iMsg = 0
While 1
$iMsg = GUIGetMsg()
Switch $iMsg
Case $iOKButton
MsgBox($MB_SYSTEMMODAL, "GUI Event", "You selected the OK button.")
Case $GUI_EVENT_CLOSE
MsgBox($MB_SYSTEMMODAL, "GUI Event", "You selected the Close button. Exiting...")
ExitLoop
EndSwitch
WEnd
Code : Tout sélectionner
While 1
Switch GUIGetMsg()
Case $iOKButton
MsgBox($MB_SYSTEMMODAL, "GUI Event", "You selected the OK button.")
Case $GUI_EVENT_CLOSE
MsgBox($MB_SYSTEMMODAL, "GUI Event", "You selected the Close button. Exiting...")
ExitLoop
EndSwitch
WEnd