Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using $XFERSTATUS in a while statement

Status
Not open for further replies.

paasmith

Programmer
May 21, 2002
1
US
I'm helping someone debug some aspect code. I have a question about the fact that $XFERSTATUS gets reset to 0 after it is accessed. There is a while loop in the code like:
sendfile ZMODEM <filename>
while $XFERSTATUS
iTemp = $XFERSTATUS
yield
endwhile
It seems like iTemp is being set to zero even when the transmission is successful. Is the while resetting $XFERSTATUS to zero?????
Trish Smith
 
Here's what we've been using in production for a long time:

INTEGER XferFlag = 0
Sendfile Zmodem $FILESPEC
while $XFERSTATUS
yield
XferFlag = $XFERSTATUS
endwhile
termmsg &quot;`r`nTransfer Status = %d&quot; XferFlag

Now, there is a funky catch. Are you uploading or downloading? If you uploading, THEN download, you'll need to add this segment BEFORE the command to download from the host is issued:

while $XFERSTATUS
yield
endwhile
transmit &quot;Download^M&quot;
getfile ZMODEM
while $XFERSTATUS
yield
SentFlag = $XFERSTATUS
endwhile
termmsg &quot;`r`nTransfer Status = %d`r`n&quot; SentFlag

I have only used this on a Windows 2000 platform so if you using anything else, it may not work. Also, maybe try rebooting...lemme know what happens...

Roger
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top