home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / S12192.ZIP / README.Q < prev    next >
Text File  |  1990-02-02  |  2KB  |  74 lines

  1. This is an example of using OS/2 queues from compiled BASIC. In this 
  2. example, two compiled BASIC processes running in two different OS/2 
  3. screen groups communicate with each other through a queue. The example 
  4. uses the following MS OS/2 API calls:
  5.  
  6.    DosCreateQueue
  7.    DosOpenQueue
  8.    DosReadQueue
  9.    DosWriteQueue
  10.    DosQueryQueue
  11.    DosCloseQueue
  12.    DosAllocShrSeg
  13.    DosGetShrSeg
  14.  
  15. This information applies to Microsoft BASIC Compiler Versions 6.00 and
  16. 6.00b for MS OS/2, and to Microsoft BASIC Professional Development 
  17. System (PDS) Version 7.00 for MS OS/2. (This information does not 
  18. apply to Microsoft QuickBASIC, which supports only the MS-DOS 
  19. operating system.)
  20.  
  21. More Information:
  22.  
  23. The following files make up this example:
  24.  
  25. 1. Q1.BAS - A program that creates/reads to a Queue
  26.  
  27. 2. Q2.BAS - A program that opens/writes to a Queue
  28.  
  29. 3. QUEUE.BI - An include file used by Q1.BAS and Q2.BAS
  30.  
  31. 4. UTIL.BAS - BASIC routines to read/write shared memory
  32.  
  33. 5. README.Q - Text file describing how to compile, link, and run this 
  34.               example.
  35.  
  36. The following are compile and LINK instructions:
  37.  
  38. 1.  BC q1;
  39.  
  40. 2.  BC q2;
  41.  
  42. 3.  BC util /x;
  43.  
  44. 4.  LINK q1 util;
  45.  
  46. 5.  LINK q2 util;
  47.  
  48. The following are execution instructions:
  49.  
  50. 1. Create two OS/2 protected mode sessions.
  51.  
  52. 2. Run Q1 in one session. The program performs the following
  53.    sequence of steps:
  54.  
  55.    a. Create the Queue (DosCreateQueue).
  56.  
  57.    b. Allocate Shared Segment (DosAllocShrSeg).
  58.  
  59.    c. Query the Queue until an error or an item is entered
  60.       (DosQueryQueue).
  61.  
  62.    d. Read the items out of the Queue (DosReadQueue).
  63.  
  64.    e. Close the Queue (DosCloseQueue).
  65.  
  66. 3. When Q1 is waiting for Queue information, start Q2 in the other
  67.    MS OS/2 protected mode session. The program performs the following
  68.    sequence of steps:
  69.  
  70.    Get the segment shared in Q1 (DosGetShrSeg)
  71.    Open the Queue (DosOpenQueue)
  72.    Write to the Queue (DosWriteQueue)
  73.    Exit the program
  74.