bitbucketz
Programmer
Hello All -
I am trying to read a series of tab seperated commands from a text file into an aspect script. I have read through most of the postings here and at aspectscripting.com and come up with the following script. It compiles fine but when run never dials the modem. I am running Procomm Plus 4.8 on Win2k Professional. Does anyone see an obvious errors here?
Thnx,
WC
proc main
string sLine, sVendorID, sDealerID, sPullType, sNum, sLoginName, SLoginPass, sAcctString1, sAcctString2, sAcctString3
fopen 0 "diallist.txt" READ TEXT ;Open the data file
while not feof 0 ;While the file still has data
fgets 0 sLine ;Read a line of data
strtok sVendorID sLine "`t" 1 ;Get the first tab delimited field
strtok sDealerID sLine "`t" 1 ;Get the second tab delimited field
strtok sPullType sLine "`t" 1 ;Get the third tab delimited field
strtok sNum sLine "`t" 1 ;Get the fourth tab delimited field
strtok sLoginName sLine "`t" 1 ;Get the fifth tab delimited field
strtok SLoginPass sLine "`t" 1 ;Get the sixth tab delimited field
strtok sAcctString1 sLine "`t" 1 ;Get the seventh tab delimited field
strtok sAcctString2 sLine "`t" 1 ;Get the eighth tab delimited field
strtok sAcctString3 sLine "`t" 1 ;Get the nineth tab delimited field
if not nullstr sNum ;If entry is not blank
dial DATA sNum ;Then dial it
while $DIALING ;Pause while dialing
yield
endwhile
if $CARRIER ;If connected...
waitfor "CONNECT" 90
transmit "hel menu^M"
waitfor "TERMINAL" 30
transmit "^M"
waitfor "USER ID" 30
transmit sLoginName
transmit "^M"
transmit sLoginPass
transmit "^M"
waitfor "SELECTION" 30
if not nullstr sAcctString1 ;If entry is not blank
transmit sAcctString1
transmit "^M"
endif
if not nullstr sAcctString2 ;If entry is not blank
transmit sAcctString2
transmit "^M"
endif
if not nullstr sAcctString3 ;If entry is not blank
transmit sAcctString3
transmit "^M"
endif
transmit "6910^M" ;go to reports menu
endif
endif
endwhile
fclose 0
endproc
I am trying to read a series of tab seperated commands from a text file into an aspect script. I have read through most of the postings here and at aspectscripting.com and come up with the following script. It compiles fine but when run never dials the modem. I am running Procomm Plus 4.8 on Win2k Professional. Does anyone see an obvious errors here?
Thnx,
WC
proc main
string sLine, sVendorID, sDealerID, sPullType, sNum, sLoginName, SLoginPass, sAcctString1, sAcctString2, sAcctString3
fopen 0 "diallist.txt" READ TEXT ;Open the data file
while not feof 0 ;While the file still has data
fgets 0 sLine ;Read a line of data
strtok sVendorID sLine "`t" 1 ;Get the first tab delimited field
strtok sDealerID sLine "`t" 1 ;Get the second tab delimited field
strtok sPullType sLine "`t" 1 ;Get the third tab delimited field
strtok sNum sLine "`t" 1 ;Get the fourth tab delimited field
strtok sLoginName sLine "`t" 1 ;Get the fifth tab delimited field
strtok SLoginPass sLine "`t" 1 ;Get the sixth tab delimited field
strtok sAcctString1 sLine "`t" 1 ;Get the seventh tab delimited field
strtok sAcctString2 sLine "`t" 1 ;Get the eighth tab delimited field
strtok sAcctString3 sLine "`t" 1 ;Get the nineth tab delimited field
if not nullstr sNum ;If entry is not blank
dial DATA sNum ;Then dial it
while $DIALING ;Pause while dialing
yield
endwhile
if $CARRIER ;If connected...
waitfor "CONNECT" 90
transmit "hel menu^M"
waitfor "TERMINAL" 30
transmit "^M"
waitfor "USER ID" 30
transmit sLoginName
transmit "^M"
transmit sLoginPass
transmit "^M"
waitfor "SELECTION" 30
if not nullstr sAcctString1 ;If entry is not blank
transmit sAcctString1
transmit "^M"
endif
if not nullstr sAcctString2 ;If entry is not blank
transmit sAcctString2
transmit "^M"
endif
if not nullstr sAcctString3 ;If entry is not blank
transmit sAcctString3
transmit "^M"
endif
transmit "6910^M" ;go to reports menu
endif
endif
endwhile
fclose 0
endproc