* ===============================================================
* UPLOAD -- Demonstrates the XFER API to upload information from 
*           the host application to the PC running Co*STAR.   
*           
*           This sample program creates a template file called 
*           SAMPLE.KEY and then uses the BUTTONBAR API to set
*           the ButtonBar to this information.
*
* WARNING:  This program will overwrite the SAMPLE.KEY file. If
*           you have named one of your templates SAMPLE.KEY you 
*           should change the filename below.
*
* ===============================================================
   
   EQU MAGIC TO CHAR( 127 )
   EQU EOF TO CHAR( 127 )
   
*  String to hold output    
   ENTRIES = ""

   
*  Use the XFER API to instruct Co*STAR to receive a file
*  using ASCII file transfer.  The ,1 parameter will
*  cause all transfer status messages to appear in the 
*  error text box in Co*STAR's lower right hand corner.

   PRINT MAGIC:"UWXFERAR,sample.key,1":MAGIC:


*  The data statements for the buttonbar file
   DATA "[MENU1]"
   DATA "MenuTitle=Sample Buttons"
    
   DATA "Menu1=ClearImage"
   DATA "Keys1=!MUW0"
    
   DATA "Menu2=Dial Office"
   DATA "Keys2=ATDT 1 555-5555^m"
 
   DATA "Menu3=HangUp"
   DATA "Keys3=+++!D1000 ATH^m"
    
   DATA "Menu4=List Tape"
   DATA "Keys4=cpio -itvcB < /dev/rmt/0^M"
    
   DATA "EOF"


*  Read items for buttonbar
   LOOP

*  Turn off any displays to the screen

         HUSH ON
         INPUT STRING 
         HUSH OFF
*
*  Build the button bar string and append a CR 
      UNTIL STRING = "EOF"
         ENTRIES := STRING:CHAR( 10 )
   REPEAT

*
*
*   Append an EOF and print the entries to CO*STAR
    ENTRIES := EOF
    PRINT ENTRIES:


* Now, activate the button bar, notice the DOS path .\

   PRINT MAGIC:"UWBUTTONBAR.\sample.key,1":MAGIC:
   PRINT
   PRINT "Done. The ButtonBar should contain the new template information."
      

END

