* ===============================================================
* DOWNLOAD -- Sample program to DOWNLOAD a text file from the PC
*             to the host application.   Shows use of the XFER
*             API command.
*
*
* ===============================================================

   EQU MAGIC TO CHAR( 127 )                   
   EQU EOF TO CHAR( 127 )                     
                                              
   DONE = 0                                   
   TOTAL = 0

* ========================================================
*  Send the WIN.INI file from the PC to this application  
*  using the XFER API with and ASCII Send option.
* ========================================================
                                              
   PRINT MAGIC:"UWXFERAS,win.ini":MAGIC:      
            
   LOOP
      CH = KEYIN( )                      ;REM Retrieve the char
      TOTAL = TOTAL + 1                  ;REM Keep tally
      IF CH = EOF THEN                   ;REM Check for End of File
         DONE = 1
      END

      REM Write to file here  
      
   WHILE DONE = 0 REPEAT
   
   PRINT 
   PRINT "Transfer complete! ":TOTAL:" characters received."
        

END
