home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 339.lha / SerMod / Docs / ROBBS.intro.doc.pp / ROBBS.intro.doc
Text File  |  1990-02-08  |  13KB  |  233 lines

  1.  
  2. Introduction to ROBBS
  3.  
  4. (c) Copyright Larry Phillips 1988
  5.  
  6.     The Amiga, by its very nature, encourages a different sort of
  7. program. On some machines, you will see word processors integrated
  8. with database managers, spreadsheets, and mailing list programs. Great
  9. efforts are taken by the authors of these programs to provide a lot of
  10. features, and to smoothly integrate the various parts of the package.
  11. You will also, on single-tasking computers, find features in large and
  12. small programs that do mundane small jobs, like deleting a file,
  13. listing a directory, and so on.  The reason these features are there
  14. is because it is usually not possible to do the job unless you are
  15. willing to exit from a program.  If you've ever looked for a
  16. particular program, or set of programs to do something like remote
  17. updating of a database over the modem, you have probably come away
  18. frustrated that the only programs you could find were those that could
  19. only do it in a 'batch mode', after the day's business, and while your
  20. local database program was inactive.  Well, we Amiga owners know that
  21. there is a better way, and we have the machine that can solve this
  22. type of problem.
  23.  
  24.     Because the Amiga is a multi-tasking machine, there is not much
  25. reason for an author to include those features that are best handled
  26. by other programs. As an example, your terminal program does not need
  27. to be able to get a directory listing, because it is just as easy to
  28. flip to a CLI (or bring up another CLI) to do the job. In effect, your
  29. simplest terminal program is far more powerful, or at least
  30. potentially far more powerful than any you might find on some other
  31. machines.  You can run virtually all other programs while online,
  32. giving you a freedom and flexibility that can only be dreamed of on
  33. lesser machine.
  34.  
  35.     While this ability is important, there is another level of
  36. versatility that is, as yet, untapped. It is nice to be able to run
  37. different programs at the same time, but wouldn't it be much nicer if
  38. you could use any program with any other program as if they had been
  39. written to work together?  It isn't possible today, at least not with
  40. all possible programs, given the programs we do have available, but it
  41. could be at some future time.  I have heard an Amiga owner say "A
  42. database, word processor, and animator linked together...  could put
  43. Hypercard to shame." Personally, I can't think of a single use for
  44. those three program types acting in an integrated manner, but the fact
  45. is that someone did think it would be a marvellous thing.  I doubt the
  46. author of any database program would even consider writing the code to
  47. allow it to link up with the other two, and the same goes for the
  48. other two authors.  Even if they did think it was a good idea, what
  49. programs would they choose to link up with?  If it happened to be one
  50. you particularly like, you'd be happy, but if not, you would probably
  51. keep wishing that he'd chosen your favourite.
  52.  
  53.     These thoughts led me to the idea that what we really needed was a
  54. series of building blocks designed to be hooked together, each
  55. providing a limited, but necessary set of functions. I can't take
  56. credit for the basic idea though.  This is a philosophy which has
  57. stood the test of time in at least a few operating systems.  Unix is
  58. one, and even if you have no particular love for Unix, you must admit
  59. that the ability to build complex programs from simple, small programs
  60. is a powerful idea. I wanted to go one step further though, and write
  61. a series of modules that can be controlled to a finer degree. While
  62. Unix allows manipulation of programs via stdin, stdout, pipes,
  63. redirection, and intermediate files, I wanted to 'get into the guts'
  64. of small programs and allow them to be manipulated more directly.
  65.  
  66.     The Amiga has a built-in feature that is ideal for our purposes. It
  67. can send messages between programs via a system of message ports. A
  68. message port is a simple idea. A program can create a message port,
  69. give it a name, and register it with the operating system. Once that
  70. is done, any other program can look for the message port by name, and
  71. if the name is found, can then send a message to the port. The message
  72. is received by the message port, and the program that created the port
  73. can act upon that message in any way. The receiving program, of
  74. course, must be able to understand the message. The receiving program
  75. then replies to the message, to let the sending program know that it
  76. was received, allowing the sending program to re-use the memory
  77. allocated for the message.
  78.  
  79.     Prior to the advent of ARexx, the messaging ability of the Amiga
  80. was limited to programs compiled in a number of different languages,
  81. putting the capability beyond many Amiga owners. ARexx, however, has
  82. full messaging ability, and can send messages to other ARexx programs
  83. (scripts) or to programs written to understand ARexx messages.  This
  84. opens up a whole new area for those would-be programmers who like
  85. interpreted languages, allowing them to write simple (or not so
  86. simple) ARexx programs to call other programs as 'building blocks', a
  87. sort of a computer 'erector set' for applications.
  88.  
  89.     After months of talking to people about this idea, and not being
  90. able to interest anyone in it to a sufficient degree thet they would
  91. actually write modules, I decided to write a few myself. I have called
  92. the series of modules ROBBS, for Rexx Object Building Block System.
  93. The first module in the series is called SerMod (for Serial Module).
  94. It was designed to be small (about 12K, but it could be made smaller
  95. still), and to have a limited set of functions, dealing only with
  96. things that need to be done for serial communication.  It started life
  97. as a combination serial module and display, but as soon as the serial
  98. part was working to my satisfaction, I split the display out and
  99. started the second module, called (you guessed it), DispMod.  DispMod
  100. was a simple display program having only one type of window, and only
  101. enough functionality to be able to handle keyboard input and text
  102. output.
  103.  
  104.     By itself, SerMod is somewhat limited. You can run it from a
  105. script, and send it commands from the script, to do a variety of jobs,
  106. such as setting the serial port parameters, sending text, receiving
  107. text, and checking for matches with user defined strings on the
  108. incoming data.  With an appropriate script, it could act as a file
  109. transfer utility, a BBS, or a program to allow remote CLI-like
  110. operation of your machine (in a limited manner). With the addition of
  111. DispMod, the combination of a script, SerMod, and DispMod become a
  112. fairly powerful terminal program.  When I say 'fairly powerful', I
  113. refer to the complete scripting capability provided by ARexx, since
  114. the protocol modules, menu module, gadget module, and so forth, have
  115. yet to be written.
  116.  
  117.     I chose to write SerMod first, since many programs can benefit from
  118. serial communication capability, and because it is not difficult to
  119. visualize ways in which you can combine a serial module with other
  120. programs. SuperBase is about to arrive (it may have already), with an
  121. ARexx interface, MicroFiche Filer already has one. CygnusEd
  122. Professional, TxEd, UEdit, and DME all have ARexx interfaces.  PCLO
  123. and PCLO Plus have one.  With SerMod and an ARexx program, any of
  124. these programs have suddenly acquired the ability to communicate over
  125. the serial port, locally using a null modem cable, or remotely via modem.
  126. If there is enough interest in this project, there will undoubtedly be more
  127. modules written, small programs that do only a few things, and that allow you
  128. to custom-build other applications.  Even those who have no desire to program,
  129. even in ARexx, can benefit from the ARexx programs written for ROBBS.
  130.  
  131.     Perhaps a few words about the philosophy behind ROBBS modules would
  132. be in order.  ROBBS stands for Rexx Object Building Block System.  A
  133. typical ROBBS application will consist of one or more ROBBS modules,
  134. controlled by one or more ARexx scripts. In addition, other programs
  135. might be called, whether or not they actually have an ARexx interface.
  136. Any program that can give you the data you need, perhaps in a file,
  137. can be used with an application.
  138.  
  139.     Each module in a ROBBS application should do only a few operations,
  140. to keep the size down, to simplify programming, and to ensure that
  141. there is little duplication of effort between modules. Only those
  142. commands that make sense to the particular application need be
  143. provided. There need be no 'standard' set of commands across all
  144. modules, for the above reason, and because it is easy enough to change
  145. the controlling ARexx program to account for any differences. There
  146. are a few commands that make sense to all modules, and these should be
  147. called by the same name in all modules. Examples of these are STATUS,
  148. CONNECT, CTRL, and DIE (more about these later).
  149.  
  150.     At this time, I'd like to give you an overview of what a typical
  151. module might look like from an ARexx programmer's point of view, and
  152. I'll use SerMod as an example. Though it is 'finished', it is not
  153. 'cast in stone'. If you have any suggestions for additional features,
  154. I would like to hear about them.
  155.  
  156.                         -----
  157.  
  158.              Commands that SerMod understands:
  159.  
  160. RXD - Turns the serial received data on or off.  This is to allow
  161.       other programs that open the serial port in shared mode to have
  162.       access to it without interference.  Accepts 'ON' or 'OFF' as
  163.       arguments
  164.  
  165. TXD - Enables or disables transmitted data. Allows another program to
  166.       send data without any interference from Sermod.  The other
  167.       program must open the serial device in shared mode. Accepts 'ON'
  168.       or 'OFF' as arguments
  169.  
  170. SEND - Send a string out the serial port. A variation of this command,
  171.        LSEND, sends a string with an appended Carriage Return character.
  172.        Accepts a string as an argument.
  173.  
  174. MATCH - Sets up a 'match string' for Sermod to watch for in the
  175.         received data.  When a match is detected by SerMod, a message
  176.         is sent to the CTRL port, specifying the number of the string
  177.         that matched.  Sermod allows 10 strings of up to 100
  178.         characters each, and the MATCH command can be issued any
  179.         number of times, which means that you can replace any match
  180.         strings already set up.  MATCH also lets you clear any
  181.         matchstring, or clear all matchstrings. Note that SCAN must be
  182.         active in order for a match to have any effect. Accepts a
  183.         number between 0 and 9, followed by a string as an argument.
  184.         Example: MATCH 3 'This is a string'
  185.  
  186.  
  187. SCAN - Enables the matching of received data with the MATCH strings
  188.        currently active. Takes either ON or OFF as a parameter.
  189.  
  190. CONNECT - Connects the received data with a named message port.
  191.           CONNECT also lets you set up the command that will be used
  192.           to send the data, since not all modules have the same
  193.           command for receiving data.
  194.           Sometimes you might want the controlling script to receive
  195.           all incoming data, while at other times you would want the
  196.           data to go directly to another ROBBS module.
  197.           Accepts two arguments, a port name and a command.
  198.  
  199. CTRL - Connects Sermod to another port for control purposes. While any
  200.        script program may send messages to Sermod, Sermod sends
  201.        received data to the 'CONNECT' port, and 'matched' messages to
  202.        the controlling port. This means that you can pass control from
  203.        script to script, as you see fit. Accepts a port name as an
  204.        argument.
  205.  
  206. COMM - Lets you set baud rate, mode (echo, noecho), handshaking, and
  207.        translation (7 or 8 bits for received data). See detailed
  208.        command explanation for a complete discussion of arguments
  209.        required.
  210.  
  211. DIE - Commands Sermod to quit and unload from the system. If all
  212.       messages sent from Sermod have been replied, this will be done
  213.       immediately.  If there are any outstanding unreplied messages, a
  214.       message will be printed to the CLI from which Sermod was
  215.       launched to that effect, and you must then issue the REALLY_DIE
  216.       message to remove Sermod.  This shoudl never happen in a
  217.       debugged application, and is provided as an emergency escape for
  218.       the times when a script terminates early due to an error.
  219.       Needs no arguments.
  220.  
  221. STATUS - Returns a string consisting of the current status of Sermod.
  222.          It contains information on serial port settings, the SCAN,
  223.          TXD, and RXD state, the CONNECT and CTRL ports, and, for
  224.          future use, the address of the IOSerial Request structure
  225.          Sermod is using. Needs no arguments. See detailed command
  226.          description for format of returned status string.
  227.  
  228.                            -----
  229.  
  230. This introductory text appeared originally in Transactor for the Amiga.
  231.  
  232.  
  233.