I have a script that is downloading files off a server. Right now the script downloads one file and then I have to rerun it to check of more files. I would love to figure out a way to make it download over and over until the server responds 'no file available'.
I figure there has got to be a way to put a loop in there somehow. As long as I don't receive that 'no file available' back I want to put a "D^M" in there to download another file. Once it's downloaded a file I get back a '[ ]' where the "D^M" goes in. If i try and download a file and there is no available file i get the 'no file available' response. so something like??????
do while serverresponse <> 'no file available'
"D^M"
loop
hangup
Any ideas will be greatly appreicated. below is the current procedure.
I figure there has got to be a way to put a loop in there somehow. As long as I don't receive that 'no file available' back I want to put a "D^M" in there to download another file. Once it's downloaded a file I get back a '[ ]' where the "D^M" goes in. If i try and download a file and there is no available file i get the 'no file available' response. so something like??????
do while serverresponse <> 'no file available'
"D^M"
loop
hangup
Any ideas will be greatly appreicated. below is the current procedure.
Code:
proc downloadit
integer iStatus
;DIAL:
DIALNUMBER DATA "9,99999999999" ; dial phone number
PAUSE 10
TRANSMIT "@D^M"
PAUSE 10
WAITFOR "TERMINAL="
TRANSMIT "D1^M"
WAITFOR "@"
TRANSMIT "xxxx1^M"
WAITFOR "Production or Test (P/T)?"
TRANSMIT "P^M"
WAITFOR "Is this correct? (YES or NO)"
TRANSMIT "YES^M"
WAITFOR "Logon ID:[ ]"
TRANSMIT "xxxxxxxx^M"
WAITFOR "Password:[ ]"
TRANSMIT "xxxxxxxx^M"
WAITFOR "D)ownload U)pload G)oodbye:[]"
TRANSMIT "D^M"
WAITFOR "Payer or Submitter/Provider: (P/S)[]"
TRANSMIT "S^M"
WAITFOR "Transaction Type: []"
TRANSMIT "MCDS^M"
WAITFOR "K)ermit"
PAUSE 2
TRANSMIT "Z^M"
WAITFOR "D)ownload U)pload G)oodbye"
TRANSMIT "G^M"
hangup ; Hang up the phone line.
endproc