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!

selecting multiple items in a dialogbox ? 1

Status
Not open for further replies.

teletubby5e

Technical User
Oct 31, 2002
147
US
Hello,
I am having a bit of trouble getting a script to work. Basically, I am looking to be able to select multiple items from a drop down list, and have each selection spawn and run another routine, or even do an execute to another script. The trouble I am having is that I can only get it to make single selections, even after altering the following part of the script that says single.
Thanks for any help.
Jeff

;===============================
;sample section - begin
;===============================
szList = "Caller ID,Call Forwarding"
dialogbox 0 55 96 100 74 11 "Enter Feature Desired"
listbox 1 5 5 90 40 szList single FEAT1 sort
pushbutton 2 28 52 40 14 "&Exit" ok default
enddialog
while 1
dlgevent 0 Event ; Get the dialog event.

switch Event ; Evaluate the event.
case 0 ; No event occurred.
endcase
case 1 ; Something was chosen.
usermsg "`"%s`" selected!" FEAT1

IF STRCMP FEAT1 "Caller ID"
FEAT1="/LIRCNMA"
ELSE

IF STRCMP FEAT1 "Call Forwarding"
FEAT1="/CFV"
ELSE

ENDIF
ENDIF

endcase
default ; Exit case chosen.
exitwhile ; Exit the loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy the dialog box.

;===============================
;sample section - begin
;===============================
 
I modified your initial script (mainly making the check for selected options when the Exit button was chosen instead of the listbox item) and here is the result I came up with. You can replace the scripts in the execute commands with the scripts you want to call, or just remove the execute commands and replace them with the code you want to run.

proc main
string szList, FEAT1
integer Event

szList = "Caller ID,Call Forwarding"
dialogbox 0 55 96 100 74 11 "Enter Feature Desired"
listbox 1 5 5 90 40 szList multiple FEAT1 sort
pushbutton 2 28 52 40 14 "&Exit" ok default
enddialog
while 1
dlgevent 0 Event ; Get the dialog event.

switch Event ; Evaluate the event.
case 0 ; No event occurred.
endcase
case 1
endcase
case 2 ; Exit button selected
IF strsearch FEAT1 "Caller ID"
execute "hints.wax"
ENDIF
IF STRsearch FEAT1 "Call Forwarding"
execute "hostutil.wax"
ENDIF
exitwhile
endcase
default ; Exit case chosen.
exitwhile ; Exit the loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy the dialog box.
endproc aspect@aspectscripting.com
 
Thanks! That is exactly what I was trying to do. You kept it simple for me. I ended up just putting the code procedures in the main script instead of chaining another script, since these are all pretty small procedures i am running. Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top