I've got a quick question. Below is a script I am trying to gt to work and it is with the exception of one problem. When it gets to the second key entry it hangs up. What am I doing wrong?
proc main
string sline, tn,key0,key1,key2
fopen 0 "3904CHG.txt" READ ;Open our data file
while not feof 0 ;While the file still has data
fgets 0 sLine ;Read a line of data
strtok tn sLine "`t" 1 ;Get the first field
strtok key0 sLine "`t" 1 ;Get the second field
strtok KEY1 sLine "`t" 1 ;Get the third field
;strtok KEY2 sLine "`t" 1 ;Get the fourth field
set txpace 30
TRANSMIT "^M"
waitfor "req:"
transmit "CHG^M"
waitfor "type"
transmit "3904^M"
waitfor "tn "
transmit tn
transmit "^M"
waitfor "ECHG"
transmit "YES^M"
waitfor "ITEM"
transmit KEY0
transmit "^M~"
transmit "^M~"
transmit "^M~"
waitfor "KEY"
transmit KEY1
transmit "^M~"
transmit "^M~"
transmit "^M~"
waitfor "KEY"
transmit KEY2
transmit "^M~"
transmit "^M~"
transmit "^M~"
transmit "^M~"
transmit "^M~"
endwhile
fclose 0
endproc
proc main
string sline, tn,key0,key1,key2
fopen 0 "3904CHG.txt" READ ;Open our data file
while not feof 0 ;While the file still has data
fgets 0 sLine ;Read a line of data
strtok tn sLine "`t" 1 ;Get the first field
strtok key0 sLine "`t" 1 ;Get the second field
strtok KEY1 sLine "`t" 1 ;Get the third field
;strtok KEY2 sLine "`t" 1 ;Get the fourth field
set txpace 30
TRANSMIT "^M"
waitfor "req:"
transmit "CHG^M"
waitfor "type"
transmit "3904^M"
waitfor "tn "
transmit tn
transmit "^M"
waitfor "ECHG"
transmit "YES^M"
waitfor "ITEM"
transmit KEY0
transmit "^M~"
transmit "^M~"
transmit "^M~"
waitfor "KEY"
transmit KEY1
transmit "^M~"
transmit "^M~"
transmit "^M~"
waitfor "KEY"
transmit KEY2
transmit "^M~"
transmit "^M~"
transmit "^M~"
transmit "^M~"
transmit "^M~"
endwhile
fclose 0
endproc