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!

Pausing on Multiple Listbox select

Status
Not open for further replies.

MyFlight

Technical User
Feb 4, 2002
193
I have written a script to show a ListBox that allows multiple selections.

However, is the someway to replace the PAUSE 3 that is under Case 1? I would like for it to waituntil the user Clicks the OK Button.

Any suggestions?? Here is my script.



#define WorkDir "C:\Temp Data Files\Raw Data\"
#define SaveDir "C:\Temp Completed Reports\"
#define sEnter "^M"
#define szSpace " "

proc main
integer Event
integer nItem = 0 ; Integer to indicate current file.
string szList, sSystem, fName2

fName2 = "Temp Export Tables.txt"
sSystem = "SPCFG,SPBIL,SPNBIL,NPSTND,NPPBX,SASTAT,SSSTAT,SMSTAT,SOSTAT"

chdir WorkDir
fopen 2 fName2 CREATE TEXT
dialogbox 0 241 99 152 138 11 "Select The TABLES you want Exported"
listbox 1 28 8 90 89 sSystem multiple szList sort
pushbutton 2 54 114 40 14 "&OK" 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.
pause 3
dlgsave 0 1
fwrite 2 szList 16
pause 2
fclose 2
endcase
default ; Exit case chosen.
exitwhile ; Exit the loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy the dialog box.
endproc
 
Is the problem that the script is writing to the file each time they select an item in the listbox instead of waiting until the dialog is closed? If so, then I would move the code to write to the file after the dlgdestroy command and only write to the file if szList is not null (can check with an if nullstr command).


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top