Greetings all,
I'm still a beginner to Aspect scripting and am trying to grasp how I can skip a line in a text file. I have the following script below and am slowing trying to grasp opening a text file but cannot find how I skip lines in the text file when I encounter a target condition. Your help will be greatly appreciated.
the text file is in this format
902101,7
902103,7
902104,7
the script that i have is listed below.
proc main
fopen 1 "C:\Program Files\Procomm Plus\Capture\authcode.txt" READ
if failure
usermsg "could not open the file."
else
transmit "****"
transmit "ld 88^M"
waitfor "REQ"
transmit "new^M"
waitfor "TYPE "
transmit "aut^M"
waitfor "CUST "
transmit "0^M"
waitfor "SPWD "
transmit "^M"
;pause 1
fseek 1 0 0
while not feof 1
fgets 1 s0
strtok s1 s0 "," 1
strtok s2 s0 "," 1
DelLineFeed (&s2)
strlen s1 i0
if (i0 > 1)
ld88auth()
else
Transmit "****^M"
halt
endif
endwhile
endif
endproc
proc ld88auth
when TARGET 1 "AUTH009" call skipline
when TARGET 2 "AUTH005" call skipline
waitfor "CODE "
transmit s1
transmit "^M"
waitfor "SARC "
transmit "^M"
waitfor "CLAS "
transmit s2
;transmit "^M"
endproc
PROC DelLineFeed
param string szStr
integer Pos
strlen szStr Pos
if (Pos > 2)
strDelete szStr (Pos-1) 1
endif
endproc
PROC skipline
???????
I'm still a beginner to Aspect scripting and am trying to grasp how I can skip a line in a text file. I have the following script below and am slowing trying to grasp opening a text file but cannot find how I skip lines in the text file when I encounter a target condition. Your help will be greatly appreciated.
the text file is in this format
902101,7
902103,7
902104,7
the script that i have is listed below.
proc main
fopen 1 "C:\Program Files\Procomm Plus\Capture\authcode.txt" READ
if failure
usermsg "could not open the file."
else
transmit "****"
transmit "ld 88^M"
waitfor "REQ"
transmit "new^M"
waitfor "TYPE "
transmit "aut^M"
waitfor "CUST "
transmit "0^M"
waitfor "SPWD "
transmit "^M"
;pause 1
fseek 1 0 0
while not feof 1
fgets 1 s0
strtok s1 s0 "," 1
strtok s2 s0 "," 1
DelLineFeed (&s2)
strlen s1 i0
if (i0 > 1)
ld88auth()
else
Transmit "****^M"
halt
endif
endwhile
endif
endproc
proc ld88auth
when TARGET 1 "AUTH009" call skipline
when TARGET 2 "AUTH005" call skipline
waitfor "CODE "
transmit s1
transmit "^M"
waitfor "SARC "
transmit "^M"
waitfor "CLAS "
transmit s2
;transmit "^M"
endproc
PROC DelLineFeed
param string szStr
integer Pos
strlen szStr Pos
if (Pos > 2)
strDelete szStr (Pos-1) 1
endif
endproc
PROC skipline
???????