-
Topic
-
Hello,
I’m trying to design an applet that is a sequence of dialogue boxes. Ordinarily, when the user presses next the applet will just move to the next dialogue box (no problem there). However, I would like the applet to exit entirely when the user presses Cancel.
My test code is below and it does not work. It seems the variable Cmd successfully gets set to cExit (999) after the Select Case statement, but loop still continues. It’s driving me crazy since I told it loop until Cmd=cExit.
Any input is appreciated!
Thanks,
Kate‘*******************
‘Global Constants
‘*******************Const cExit =999
Const cDlg1 =101
Const cDlg2 =102‘*******************
‘Main Routine
‘*******************Sub Main(ClientState, GWEvent)
Dim Dlg
Dim Cmd‘*******************
‘Dialogue 1
‘*******************
Doset Dlg = Utilities.NewControlBoxDialog
with Dlg
.Caption = “Advansys Formativ”
.Title = “Dialogue 1”
.Description = “This is Dialogue 1.”
end withCmd=cDlg1
If Cmd = cDlg1 Then
Select Case Dlg.Execute
Case Btn1 Cmd = cDlg2
Case Btn2 Cmd = cExit
Case Else Cmd = cExit
End Select
End If‘*******************
‘Dialogue 2
‘*******************
If c=Dlg2 Then
set Dlg = Utilities.NewControlBoxDialog
with Dlg
.Caption = “Advansys Formativ”
.Title = “Dialogue 2”
.Description = “Dialogue 2”
end withif Dlg.Execute = Btn1 then
MsgBox(“OK pressed”)
Else
MsgBox(“Something else pressed”)
end if
End IfLoop Until Cmd=cExit
end sub
- You must be logged in to reply to this topic.