home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / SERVER.CMD < prev    next >
OS/2 REXX Batch file  |  1991-07-07  |  2KB  |  54 lines

  1. /***************************************************************************
  2.  Date: June 11, 1991
  3.  
  4.  Sample REXX Code:  Queue Server
  5.  
  6.  Function:
  7.                     Create a private queue "FRED"
  8.                     Set this to be the current Queue
  9.                     DO FOREVER
  10.                        Wait for data to appear on the private Queue
  11.                        Read it in
  12.                        Say it
  13.                        END
  14.  
  15.  How to Use:
  16.  
  17.     This is a simple bit of sample code to show how to set up an interprocess
  18.     communication session between two OS/2 sessions using the REXX Queue.
  19.  
  20.     (1)  Open a text session and run SERVER.CMD.  Alternatively,
  21.          you could issue the command START PMREXX SERVER.CMD to run the
  22.          server in a PM session.
  23.  
  24.     (2)  Open another text session and pipe the output from any command
  25.          into the RXQUEUE filter utility and specify the private queue
  26.          named FRED.  For example,
  27.  
  28.                dir | rxqueue fred
  29.  
  30.          or strip off the extraneous stuff and just get the file names:
  31.  
  32.                dir /f | rxqueue fred
  33.  
  34.  
  35.  Author:            Jay A. Tunkel
  36.                     IBM Corporation
  37.                     OS/2(tm) Architecture and System Design
  38.                     Compuserve: 76307,502
  39.                     internet: tunkel@bcrvmpc1.vnet.ibm.com
  40.  
  41. ***************************************************************************/
  42. qid = rxqueue("Create","FRED")       /* Create a private queue            */
  43. say qid                              /* just for fun, look at the internal*/
  44.                                      /* queue ID                          */
  45.  
  46. oldqname = rxqueue("Set","FRED")     /* Change the current queue to the   */
  47.                                      /* one that was just created         */
  48. say oldqname                         /* What was the old name?            */
  49.  
  50. do forever
  51.    data = linein("QUEUE:")           /* Wait for data, then read it in    */
  52.    say data
  53.    end
  54.