home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 545b.lha / RexxHS / samplecall.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1991-09-07  |  987 b   |  43 lines

  1. /*
  2.  * SampleCall -- A short program that calls our sample command host...
  3.  */
  4.  
  5. options failat 1000
  6. options results
  7.  
  8. if( ~show( 'p', 'SAMPLEHOST' ) )then do
  9.     say "Please start SAMPLEHOST first."
  10.     exit 10
  11. end
  12.  
  13. options prompt "Please enter a command or 'help': "
  14.  
  15. do forever
  16.     parse pull linein
  17.  
  18.     if( upper( linein ) = 'HELP' )then
  19.       do
  20.         say
  21.         say "  Type a command to be sent to SAMPLEHOST.  Valid commands"
  22.         say "  are:"
  23.         say "        set rc <number>"
  24.         say "        set result <string or number>"
  25.         say "        get rc"
  26.         say "        get result"
  27.         say "        exit"
  28.         say "  The values of RC and RESULT that are returned by the"
  29.         say "  command will be printed to the screen."
  30.         say ""
  31.       end
  32.     else
  33.       do
  34.         address 'SAMPLEHOST' linein
  35.         say "Replied with RC     =" rc
  36.         say "             RESULT =" result
  37.       end
  38.  
  39.     if( upper( linein ) = 'EXIT' )then break
  40. end
  41.  
  42. exit 0
  43.