Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

question on dialog boxes

Status
Not open for further replies.

Kryolla

Technical User
Dec 6, 2001
35
I have a script that brings up a dialog box. At the end of the script I have the user answer a question Are you done? if he chooses NO I want it to bring up the dialog box and if he chooses yes then to end the script. HOW can I make it so it will always bring up the dialog box when the user chooses NO. Thanks
 
Here's a quick sample I whipped up. Basically, the dialogbox only acts if id 1 (the Yes button) is pressed, otherwise the dialogbox stays active. I basically took one of the sample scripts and added a second pushbutton. Hope this is what you were looking for!

proc main
integer Event ; Dialog box event.

dialogbox 0 8 20 257 92 2 "Completed?"
pushbutton 1 35 39 40 13 "&Yes"
pushbutton 2 182 39 40 13 "&No"
enddialog
while 1
dlgevent 0 Event ; Get dialog event.
switch Event ; Evaluate dialog event.
case 1 ; Button was pressed.
exitwhile ; Exit the while loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Get rid of dialog box.
pwexit
endproc aspect@aspectscripting.com
 
Thanks Knob, At the end of my script I have a sdlgmsg box with a yes/no. If user chooses no to go back to the beginning of the script. Thanks
 
I got it to work.

proc main

dialbox()
while iDrew !=7
sdlgmsgbox "test" "do you have more questions" question yesno iDrew ;if yes bring up dialbox
if iDrew == 6
dialbox()
else
exitwhile
endif
endwhile

dlgdestroy 0 cancel

endproc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top