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!

Script to programmed Names in LD 95

Status
Not open for further replies.

nortelcs100e5

Technical User
Oct 30, 2007
101
Hi all. I am pretty new to procomm scripts. I am installing a new 81c PBX having 940 extension, Now i have to programmed all 940 extension names through LD 95. I have an excel file in which all ext with name exist alphabetically. Can somebody gave me a script to programmed all names in LD 95 for all these 940 extensions.
Regards
 
Basically what you need to do is:

1. Use the "Record-function in ProComm to record when you
do one manual input of name on an extension in LD95.
2. Save this, and use it as a startingpoint for your script.
3. Add the DDE-function to the script to read the names
and extensions from the spreadsheet into variables that
you then use to program the names.
4. Use a "while-loop" to loop through the spreadsheet
until it reaches the end of the sheet.

Code:
string name, extension, rowcol, ExcelLink
string filename="C:\path\to\file.xls"
integer rownumber=0
proc main
if ddeinit ExcelLink "excel" filename   ;name of excel-file
  if ddeinit ExcelLink "excel" "Sheet1"
    while 1
    (rownumber++)
         strfmt rowcol "R%dC3" rownumber
         dderequest ExcelLink rowcol name      ; read name from excel.
         strreplace name "`r`n" ""  ; remove newline-return.
.
.         strfmt rowcol "R%dC24" rownumber
         dderequest ExcelLink rowcol extension            ; Read extension DN.
         strreplace extension "`r`n" ""
                 if nullstr name        ; check if cell is empty
                   exitwhile               ; then stop looping.
                 else
                     loopwhile               ; else continue.
                 endif                     ; 
              
    call AddNewName

    endwhile
  endif
endif
endproc

proc AddNewName

; your recorded part goes here.

endproc
This is NOT a working script, just typed of memory!!
But should give you some pointers to how you can do this.

Use the great helpfunction in ProComm to read more about
each command. Yes the help-function has alot of tips in it.



 
Hi geirendre ,
I really not fond of procomm scripts, it will be very helpful to me if somebody send me a working script, I will be thankful.
Regards
 
Sorry, don't know of anybody providing those services
(for free) on this forum.
Think you need to invest some effort into this matter
yourself if you realy need the help of a script.
 
You might check the samples page on my site and see if another user has submitted a script that is close to what you want to do and can be further modified to fit your needs.

 
The Meridian forum doesn't discuss scripts often and they refer you here. I've been visiting it for the last few weeks.
 
I'm not a scriptO PRO but give this one a try.
Written for Nortel software 25.40B




;Procomm Script to CHG a list of DNs and their NAMES (LD 95)
;===============================================================

integer flag=0 ;set flag

proc main
set txpace 150 ;delay for keyboard

fopen 1 "C:\phone\SAM.txt" READ ;open text file that has a list of DNs & NAMEs you want to change.
;Make a directory on your PC "C:\Phone" then use notepad or some word editor and create your list of
;numbers, will their new name (see format below) save file as "chgnames.txt"
;12345,John Doe
;55419,KH Receiving Dock
;58100,KH Telephone Switchroom

if failure
usermsg "could not open the file."
else
Transmit "****^M"
Transmit "LD 95^M" ;Go in to overlay 95

Waitfor "REQ" 3
Transmit "CHG^M"
Waitfor "TYPE" 3
Transmit "NAME^M"
Waitfor "CUST" 3
Transmit "0^M"
Waitfor "DIG" 3
Transmit "^M"
fseek 1 0 0
while 1
fgets 1 s0
if FEOF 1
exitwhile
endif
strtok s1 s0 "," 1
strtok s2 s0 "," 1
DelStr (&s1)
DelStr (&s2)
DelLineFeed (&s2)
; strfmt s4 "TN: %s" s1 ;uncomment these two for
; usermsg s4 ;troubleshooting the script
strlen s1 i0
if (i0 > 2)
LD95CHG ()
else
Transmit "****^M"
Transmit "LD 43^M"
waitfor "." 5
Transmit "EDD^M"
halt
endif
endwhile
endif
endproc

proc LD95CHG

Waitfor "DN"
Transmit s1
Transmit "^M"

if FLAG==1
FLAG=0
Transmit "^M"

return
else
Transmit s2
Transmit "^M"
Waitfor "DISPLAY_FMT"
endif
endproc


proc DelStr
param string szStr
integer Pos
while 1
if StrFind szStr "`"" Pos
StrDelete szStr Pos 1
else
exitwhile
endif
endwhile
endproc

PROC DelLineFeed
param string szStr
integer Pos
strlen szStr Pos
if (Pos > 2)
StrDelete szStr (Pos-1) 1
endif
endproc
 
A script like this should work too. You may need to tweek it a bit. It appears to run, once you are in LD 95 at the REQ: prompt.


proc main

string dn1
string name1

integer count = 0

string szline

fopen 0 "name.txt" read

while not feof 0
SZLINE = ""
fgets 0 szline

strtok dn1 szline ";" 1
strtok name1 szline ";" 1

transmit "chg^M"
waitfor "TYPE "
transmit "name^M"
waitfor "CUST "
transmit "0^M"
waitfor " CPND_LANG "
transmit "^M"
waitfor "DIG "
transmit "^M"
waitfor "DN "
transmit dn
transmit "^M"
waitfor " NAME "
transmit name1
transmit "^M"
waitfor " XPLN "
transmit "^M"
waitfor " DISPLAY_FMT "
transmit "^M"
waitfor "DN "
transmit "^M"
waitfor "DCNO "
transmit "^M"
waitfor "REQ"

count += 1

endwhile
fclose 0

endproc



name.txt
5201;John,Wayne;
5202;Jesse,James;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top