Can someone help? I have written a script to change which node of phonemail someone is on. But when I run it it will only do line one of the text file.
File Strarts here.
proc main
string sLine ;Line read from text file
integer iLen ;Integer to hold length of read string
string sExtOne ;First extension from line read from text file
string sExtTwo ;Second extension
transmit "pro^M"
waitfor "Action: "
transmit "mov^M"
if fopen 0 "A:\sale1.txt" READ ;Open text file" if fopen 0 FnameRead"
while not feof 0 ;While there is data to be read from the text file
fgets 0 sLine ;Get line of data
strlen sLine iLen ;Find length of line
if iLen == 0 ;If zero, then we have read a blank line and are at the end
exitwhile ;Exit while loop
endif
strtok sExtOne sLine "," ;Get data before the comma
strreplace sExtOne "`"" "" ;Delete quotes from the string
sExtTwo = sLine
strreplace sExtTwo "`"" "" ;Delete quotes from remaining data
strreplace sExtTwo "," "" ;Get rid of extra comma
strreplace sExtTwo ";" "" ;Get rid of extra semi-colon too
waitfor "Subscriber Name or Extension: "
transmit sExtOne
transmit "^M"
waitfor "Do you want to move this profile (Y/N)? "
transmit "y^M"
waitfor "Enter destination node number: "
transmit sExtTwo
transmit "^M"
waitfor "move profile complete. "
endwhile
endif
fclose 0
endproc
Text file it reads.
"872460","1"
"872461","1"
"872462","1"
"872463","1"
Error received.
Subscriber Name or Extension: 872460
Node: 3
Name: Training one
Extn[1]: 872460
Do you want to move this profile (Y/N)? y
Enter destination node number: 1pro
Moving profile to node 1
Moving name header ... Complete.
Moving personal greetings ... Complete.
Moving user messages ... .Complete.
Moving profile data ... Complete.
Move profile complete.
Subscriber Name or Extension:
Cannot find this form.
Subscriber Name or Extension:
File Strarts here.
proc main
string sLine ;Line read from text file
integer iLen ;Integer to hold length of read string
string sExtOne ;First extension from line read from text file
string sExtTwo ;Second extension
transmit "pro^M"
waitfor "Action: "
transmit "mov^M"
if fopen 0 "A:\sale1.txt" READ ;Open text file" if fopen 0 FnameRead"
while not feof 0 ;While there is data to be read from the text file
fgets 0 sLine ;Get line of data
strlen sLine iLen ;Find length of line
if iLen == 0 ;If zero, then we have read a blank line and are at the end
exitwhile ;Exit while loop
endif
strtok sExtOne sLine "," ;Get data before the comma
strreplace sExtOne "`"" "" ;Delete quotes from the string
sExtTwo = sLine
strreplace sExtTwo "`"" "" ;Delete quotes from remaining data
strreplace sExtTwo "," "" ;Get rid of extra comma
strreplace sExtTwo ";" "" ;Get rid of extra semi-colon too
waitfor "Subscriber Name or Extension: "
transmit sExtOne
transmit "^M"
waitfor "Do you want to move this profile (Y/N)? "
transmit "y^M"
waitfor "Enter destination node number: "
transmit sExtTwo
transmit "^M"
waitfor "move profile complete. "
endwhile
endif
fclose 0
endproc
Text file it reads.
"872460","1"
"872461","1"
"872462","1"
"872463","1"
Error received.
Subscriber Name or Extension: 872460
Node: 3
Name: Training one
Extn[1]: 872460
Do you want to move this profile (Y/N)? y
Enter destination node number: 1pro
Moving profile to node 1
Moving name header ... Complete.
Moving personal greetings ... Complete.
Moving user messages ... .Complete.
Moving profile data ... Complete.
Move profile complete.
Subscriber Name or Extension:
Cannot find this form.
Subscriber Name or Extension: