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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script stalls

Status
Not open for further replies.

kprintz

Programmer
Oct 17, 2004
141
0
0
US
I have a script to add sets to a Nortel. It retrieves data from a spreadsheet and inserts at the correct prompt in the PBX. The first pass works flawless. Any additional pass, the script stalls at the "DN" prompt. It stalls for about 10 to 15 seconds and then resumes at normal speed until it comes to DN again. The script works, just trying to figure out why it stalls at DN. Can anyone help?

Here is the script.

proc main
;**********************************************
;* ADD IVR Ports *
;*
;* This program will pull info from *
;* an excel spreadsheet to program analog
;* ports for a Meridian PBX. *
;*
*
;* Log into PBX and run from "carrot prompt" *
;**********************************************


string TN,DES,DN,NAME,QUEUE,POS,sRowCol
integer col1,col2,col3,col4,col5,col6,row
long DDEChan
col1 = 1
col2 = 2
col3 = 3
col4 = 4
col5 = 5
col6 = 6
row = 2

ddeinit DDEChan "excel" "book1,sheet1" ;Creates link with Excel Spreadsheet
if FAILURE
ddeinit DDEChan "excel" "sheet1" ;Set up link to spreadsheet.

if FAILURE ;Error if cannot link
usermsg "`a Unable to establish link `rwith Excel Spreadsheet"

endif

thetop:

transmit "LD 10^M"
waitfor "REQ"
transmit "NEW^M"
waitfor "TYPE: "
transmit "500^M"
waitfor "TN "

goto excelrip





excelrip:






strfmt sRowCol "R%dC%d" Row Col1 ;Pulling data in column A
dderequest DDEChan sRowCol TN ;Assinging value to variable tn
if stricmp TN "end`r`n" ;Testing if end of data
Transmit "^m"
Waitfor "REQ"
Transmit "****^m"
usermsg "The end is here! There is no more Data to input"

endif


strfmt sRowCol "R%dC%d" Row Col2 ;Pulling data in column B
dderequest DDEChan sRowCol DES
strfmt sRowCol "R%dC%d" Row Col3 ;Pulling data in column G
dderequest DDEChan sRowCol DN
strfmt sRowCol "R%dC%d" Row Col4 ;Pulling data in column B
dderequest DDEChan sRowCol NAME
strfmt sRowCol "R%dC%d" Row Col5 ;Pulling data in column B
dderequest DDEChan sRowCol QUEUE
strfmt sRowCol "R%dC%d" Row Col6 ;Pulling data in column B
dderequest DDEChan sRowCol POS
strreplace TN "`n" "" ;Removing line feed from string
strreplace TN "`r" ""
strreplace DES "`n" "" ;Removing line feed from string
strreplace DES "`r" ""
strreplace DN "`n" "" ;Removing line feed from string
strreplace DN "`r" ""
strreplace NAME "`n" "" ;Removing line feed from string
strreplace NAME "`r" ""
strreplace QUEUE "`n" "" ;Removing line feed from string
strreplace QUEUE "`r" ""
strreplace POS "`n" "" ;Removing line feed from string
strreplace POS "`r" ""
row = row + 1 ;Incrementing row counter

goto meridian



meridian:



transmit TN
transmit "^M"
waitfor "CDEN "
transmit "^M"
waitfor "DES "
transmit DES
transmit "^M"
waitfor "CUST "
transmit "0^M"
waitfor "MRT "
transmit "^M"
waitfor "ERL "
transmit "^M"

transmit "^M"
transmit "^M"
waitfor "DIG "
transmit "^M"
waitfor "DN"
transmit DN
transmit "^M"
waitfor "CPND "
transmit "NEW^M"
waitfor "NAME "
transmit NAME
transmit "^M"
waitfor "XPLN "
transmit "^M"
waitfor "DISPLAY_FMT "
transmit "^M"
waitfor "AST "
transmit "YES^M"
waitfor "IAPG "
transmit "1^M"
waitfor "HUNT "
transmit "^M"
waitfor "TGAR "
transmit "8^M"
waitfor "LDN "
transmit "^M"
waitfor "NCOS "
transmit "6^M"
waitfor "RNPG "
transmit "^M"
waitfor "SGRP "
transmit "^M"
waitfor "CLS "
transmit "UNR XFA WTA AGTA CPFA CPTA AGTA^M"
waitfor "SCI "
transmit "^M"
waitfor "SPID "
transmit "^M"
waitfor "PRI "
transmit "^M"
waitfor "AACD "
transmit "YES^M"
waitfor "MLWU_LANG "
transmit "^M"
waitfor "PLEV "
transmit "^M"
waitfor "FTR "
transmit "ACD "
transmit QUEUE
transmit " "
transmit POS
transmit "^M"
waitfor "FTR "
transmit "OSP 1^M"
waitfor "FTR "
transmit "ISP 255^M"
waitfor "FTR "
transmit "^M"


endif
goto thetop




endproc
 
never mind.....I think the problem was some unsed code which i removed before poting my script. It no longer stalls.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top