Hello all
I am having trouble with this script. Have used in the past with no issues. Problem is that I had never had to populate the FLEN prompt before. I need to set the FLEN to 4 for all CDP entries. The script below reads through an excel list of DNs to CDP. I've tried adding a FLEN column in the excel sheet with "4" noted for each entry or hard coding the "4" in the script. It works erratically, seems to not notice the FLEN in the waitfor and just spits it out at DSP (the next prompt) for the most part. Have started from a "Start Recorder" script to ensure (I'd hoped) that the prompts captured correctly. Have tried various waitfor parameters and pause thus far with no success. Any and all help greatly appreciated.
integer Ro = 2 ;* Starting row
string TypeDN, DNVal
string TypeFLEN, FLENVal
Proc Main
long LinkVar, SystemVar ;* Variables containing DDE Id's.
if ddeinit SystemVar "excel" "system"
ddeexecute SystemVar "[APP.MINIMIZE()]" ;* Minimize Excel
if ddeinit LinkVar "excel" "sheet1" ;* Link to Sheet 1
While Ro < 7 ;* first empty Row in Excel
strfmt TypeDN "%s%d%s%d" "R" Ro "C" 1 ;*set address of cell holding the phone's DN
strfmt TypeFLEN "%s%d%s%d" "R" Ro "C" 2 ;*set address of cell holding FLEN
;*** The following gathers the info
Dderequest LinkVar TypeDN DNVal
Dderequest LinkVar TypeFLEN FLENVal
;*** CDP the DNs
waitfor "REQ "
transmit "new^M"
waitfor "CUST "
transmit "1^M"
waitfor "FEAT "
transmit "cdp^M"
waitfor "TYPE "
transmit "dsc^M"
waitfor "DSC "
transmit DNVal
waitfor "FLEN "
transmit "4^M"
waitfor "DSP "
transmit "^M"
waitfor "RLI "
transmit "16^M"
waitfor "NPA "
transmit "^M"
waitfor "NXX "
transmit "^M"
waitfor "DSC "
transmit "^M"
Ro++ ;* Increment Row Number
Endwhile
Endif
Endif
Endproc
I am having trouble with this script. Have used in the past with no issues. Problem is that I had never had to populate the FLEN prompt before. I need to set the FLEN to 4 for all CDP entries. The script below reads through an excel list of DNs to CDP. I've tried adding a FLEN column in the excel sheet with "4" noted for each entry or hard coding the "4" in the script. It works erratically, seems to not notice the FLEN in the waitfor and just spits it out at DSP (the next prompt) for the most part. Have started from a "Start Recorder" script to ensure (I'd hoped) that the prompts captured correctly. Have tried various waitfor parameters and pause thus far with no success. Any and all help greatly appreciated.
integer Ro = 2 ;* Starting row
string TypeDN, DNVal
string TypeFLEN, FLENVal
Proc Main
long LinkVar, SystemVar ;* Variables containing DDE Id's.
if ddeinit SystemVar "excel" "system"
ddeexecute SystemVar "[APP.MINIMIZE()]" ;* Minimize Excel
if ddeinit LinkVar "excel" "sheet1" ;* Link to Sheet 1
While Ro < 7 ;* first empty Row in Excel
strfmt TypeDN "%s%d%s%d" "R" Ro "C" 1 ;*set address of cell holding the phone's DN
strfmt TypeFLEN "%s%d%s%d" "R" Ro "C" 2 ;*set address of cell holding FLEN
;*** The following gathers the info
Dderequest LinkVar TypeDN DNVal
Dderequest LinkVar TypeFLEN FLENVal
;*** CDP the DNs
waitfor "REQ "
transmit "new^M"
waitfor "CUST "
transmit "1^M"
waitfor "FEAT "
transmit "cdp^M"
waitfor "TYPE "
transmit "dsc^M"
waitfor "DSC "
transmit DNVal
waitfor "FLEN "
transmit "4^M"
waitfor "DSP "
transmit "^M"
waitfor "RLI "
transmit "16^M"
waitfor "NPA "
transmit "^M"
waitfor "NXX "
transmit "^M"
waitfor "DSC "
transmit "^M"
Ro++ ;* Increment Row Number
Endwhile
Endif
Endif
Endproc