KNOB,
Yeah been preety hectic around here lately. Here is the correct script file.
proc main
string szList, szItem, szNewItem
string fEnd = ".csv"
integer Event
szList = " IBM-BCRS Project-CBX.DIR, IBM-BCRS Project-PM.DIR, IBM-Lotus-CBX.DIR, IBM-Lotus-PM.DIR, IBM-Northern-CBX.DIR, IBM-Northern-PM.DIR, IBM-SouthCentral-CBX.DIR, IBM-SouthCentral-PM.DIR, IBM-StandAlone-PM.DIR, IBM-Western-CBX.DIR, IBM-Western-PM.DIR"
dialogbox 0 241 99 152 138 11 "Select The Directories you want Exported"
listbox 1 28 8 90 89 szList multiple szItem 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
endcase
case 2 ; Exit button selected
IF strsearch szItem "IBM-BCRS Project-CBX.DIR"
szNewItem = "IBM-BCRS Project-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-BCRS Project-PM.DIR"
szNewItem = "IBM-BCRS Project-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Lotus-CBX.DIR"
szNewItem = "IBM-Lotus-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Lotus-PM.DIR"
szNewItem = "IBM-Lotus-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Northern-CBX.DIR"
szNewItem = "IBM-Northern-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Northern-PM.DIR"
szNewItem = "IBM-Northern-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-SouthCentral-CBX.DIR"
szNewItem = "IBM-SouthCentral-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-SouthCentral-PM.DIR"
szNewItem = "IBM-SouthCentral-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-StandAlone-PM.DIR"
szNewItem = "IBM-StandAlone-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Western-CBX.DIR"
szNewItem = "IBM-Western-CBX.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
IF strsearch szItem "IBM-Western-PM.DIR"
szNewItem = "IBM-Western-PM.DIR"
dialload szNewItem ; Load the specified directory.
strcat szNewItem fEnd
; Creates a New Text File With the Name: szitem + fEnd
fopen 1 szNewItem CREATE TEXT
pause 1
call export
ENDIF
exitwhile
endcase
default ; Exit case chosen.
exitwhile ; Exit the loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy the dialog box.
endproc
proc export
integer iEntries ;Number of entries in dialing class
integer iCount ;Loop variable
string sName ;Name of Connection Directory entry
string sAreaCode
string sCompany
string sPhoneNumber
string sUserID
string sPassword
string sMisc
string sComma = ","
string fEnd = ".csv"
string sEntry
string fName = $DDIRFNAME
dialcount DATA iEntries ;Get number of data entries
for iCount = 0 upto (iEntries - 1)
dialname DATA iCount sName ;Get name of entry based on index
set dialentry access DATA sName ;Turn on dialentry for the current entry
fetch dialentry areacode sAreaCode
fetch dialentry phonenumber sPhoneNumber
fetch dialentry company sCompany
fetch userid sUserID
fetch password sPassword
fetch misc sMisc
strcat sName sComma
strcat sAreaCode sComma
strcat sPhoneNumber sComma
strcat sCompany sComma
strcat sUserID sComma
strcat sPassword sComma
strcat sMisc sComma
strcat sEntry sName
strcat sEntry sAreaCode
strcat sEntry sPhoneNumber
strcat sEntry sCompany
strcat sEntry sUserID
strcat sEntry sPassword
strcat sEntry sMisc
fputs 1 sEntry
sEntry = ""
fclear 1
endfor
fclose 1
endproc