home *** CD-ROM | disk | FTP | other *** search
- RexxWindows:
- by James Nelson, Technical Support, INOVAtronics
-
- This is an example of communication between two CanDo decks. Both decks,
- RexxWindow1 and RexxWindow2, are almost identical, except they refer to the
- other in their scripts.
- To run this example, the two decks must be in the same directory, but can
- be run from a CLI or from the WorkBench. Only one of them needs to be run
- by the user, as the other deck will be started automatically.
- The first thing you will see when you run one of the RexxWindow's is that
- it will indicate that it is polling for the other RexxWindow. This means that
- it has run the other deck, but that it is waiting for the ARexx port to
- become available. Once the other deck is started, it will send a greeting
- message to the first deck.
- Each deck consists of a Document Object and a Field Object. Type a message
- into either Field and then press the RETURN key. The message will be sent
- to the other deck, and that deck's Field will become active. You may then
- type into that Field and send a message back to the other deck.
-
- About the Decks:
-
- The first script of interest when studying either deck is the AfterStartUp
- script. It contains code examples of: 1) Finding a deck's directory,
- 2) Running a Rexx Server, 3) Waiting for the Rexx Server to become active,
- with a TimeOut to prevent an infinate wait.
- Messages are sent within the routine "SendTheText". This routine
- takes the text from Field#1, and then uses the SendMessage command with
- NORESULTS.
- Messages are received in two ARexx Objects. The first receives the
- messages which were sent by the other decks, "SendTheText" routine; the
- second waits for a "quit" command from the other deck -- which allows
- the decks to be shut down if either of them is shut down (see the
- CloseWindow Event.)
- I hope this provides a foundation for ARexx communications between
- multiple applications.
-