When I run this script I get this error. Can someone help? I'm in urgent need of help.
Error 5: Invalid identifier
Here is the scipt
string FnameRead = "c:\temp\TEST1.txt" ; File name to be opened.
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 "mod^M"
if fopen 0 "test1.txt" READ ;Open text file
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 "Name (last first) : "
transmit "^M"
waitfor "Class Number : (Previous = 311): "
transmit "^M"
waitfor "Extension [1]"
transmit sExtOne
transmit "^M"
waitfor "Would you like to disable network access for this
subscriber?[Y/N]"
transmit "n^M"
waitfor "Extension [2]"
transmit sExtTwo
transmit "^M"
waitfor "Extension [3] "
transmit ";^M"
endwhile
endif
fclose 0
endproc
Here is the text file
"2871","11871","
"2840","11840","
"2841","11841","
"2842","11842","
"5756","16756","
Error 5: Invalid identifier
Here is the scipt
string FnameRead = "c:\temp\TEST1.txt" ; File name to be opened.
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 "mod^M"
if fopen 0 "test1.txt" READ ;Open text file
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 "Name (last first) : "
transmit "^M"
waitfor "Class Number : (Previous = 311): "
transmit "^M"
waitfor "Extension [1]"
transmit sExtOne
transmit "^M"
waitfor "Would you like to disable network access for this
subscriber?[Y/N]"
transmit "n^M"
waitfor "Extension [2]"
transmit sExtTwo
transmit "^M"
waitfor "Extension [3] "
transmit ";^M"
endwhile
endif
fclose 0
endproc
Here is the text file
"2871","11871","
"2840","11840","
"2841","11841","
"2842","11842","
"5756","16756","