home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / mex / mexfiles.iqf / MEXFILES.INF
Encoding:
Text File  |  1985-02-10  |  7.6 KB  |  221 lines

  1. SOME NOTES ON MEX FILES
  2. by Irv Block
  3.  
  4.    Richard Holmes has suggested that a listing of my MEX files
  5. with an explanation of how they work might be useful to others
  6. picking their way through Ron Fowler's marvelously programmable
  7. communications package, MEX.  So here goes...
  8.  
  9.    What is so extraordinary about MEX is its ability to edit
  10. and tailor itself to the user's particular needs.  One of the
  11. features that demonstrate this capacity is the way MEX uses
  12. ***.mex files.  MEX will read any FILENAME.MEX as a "SUBMIT"
  13. file and execute the lines as commands; and it can do this
  14. either at your manual direction or automatically.
  15.  
  16.    You can tell MEX to read a FILENAME.MEX file by typing on
  17. the MEX command prompt A0>>READ FILENAME  (you can eliminate
  18. the .ext, since the program assumes the .ext to be .MEX)
  19.  
  20.    Or, even better, you can eliminate the "READ" instruction
  21. and have MEX assume that any name it doesn't recognize as a
  22. built-in command is the name of a .MEX file and should be read
  23. and performed.  Thus, simply typing A0>>FILENAME <cr, of
  24. course> will dispatch MEX on its obedient course.    This makes
  25. for very fast and fluid performance of a lot of tasks to make
  26. communications easier and quicker.
  27.  
  28.    The way you program MEX to do its "automatic read" number is
  29. with a STAT command:
  30.  
  31.     A0>>STAT EXTEND ON
  32.     A0>>CLONE NEWMEX.COM (or any other name, even
  33.                                      the same)
  34.  
  35.    The clone is now ready to do your bidding, and the following
  36. description of my .MEX files (probably crude to some of you)
  37. will give some idea of what this program can do.   They can all
  38. be extended and improved.
  39.  
  40. -----------------
  41.  
  42. INI.MEX 
  43.  
  44.    INI.MEX is the .MEX file MEX automatically looks for on
  45. starting up, whether you tell it to or not. You can disable
  46. this feature with "STAT INITFILE OFF" but you'd be making a
  47. mistake. Use it.   My INI.MEX, written with a text editor (I
  48. keep the economical TED.COM on the same disk to facilitate
  49. instant writing and editing of .MEX files) goes like this:
  50.  
  51.     LOAD KEYS.KEY
  52.     LOAD PHONE.PHN
  53.     B:^M
  54.     TYPE A:T.NOT
  55.  
  56.         [NOTE: YOU CAN ALSO WRITE THESE
  57.                COMMANDS ON A SINGLE LINE, SEPARATED BY
  58.                 SEMICOLONS.  BUT GIVING EACH COMMAND
  59.                 ITS OWN LINE, I THINK, MAKES IT EASIER
  60.                    EDIT THE FILE LATER]
  61.                                 
  62.    On automatically reading this file, then, MEX will perform
  63. the following tasks before getting itself ready to receive your
  64. further commands:
  65.  
  66.     1) It will load KEYS.KEY, the file that contains my
  67.         keystrings (First Name, Last Name, Passwords, Logoff,
  68.         etc.)  These keystrings, of course, can be written into
  69.         the file either with a text editor or with MEX itself.
  70.         Type HELP KEY for full instructions.  By using MEX's
  71.         "SAVE KEYS.KEY" command you can write your keystrings
  72.         and updates to a file.   You can "CLONE" the
  73.         keystrings, too, but that occupies space in MEX and
  74.         makes it necessary for you to redo the process each
  75.         time you make a new clone.   By having your strings in
  76.         a KEYS.KEY file and having MEX automatically load it,
  77.         you can maintain and edit your set of keystrings
  78.         independently.
  79.  
  80.     2) Mex will then load your PHONE.PHN, your library of
  81.         phone numbers that you 'SAVE'ed. (SEE HELP PHONE).  All
  82.         the points made above with reference to keystrings
  83.         apply equally to this file.    
  84.             
  85.     3) On reading the third line, MEX will log you onto
  86.         Drive B, where I assume your uploading disk will be. 
  87.         My A drive, containing the disk with MEX and assorted
  88.         associated goodies for editing and managing uploaded
  89.         and download material, is pretty full. Forgetting where
  90.         I'm logged and trying to upload a long file on Drive A
  91.         by error can be a disgusting experience.
  92.  
  93.     4) Finally, reading the last line, MEX will type out my
  94.         file T.NOT.   That file reads like this:
  95.  
  96.            *****************************************
  97.     IRV, REMEMBER TO SET UP A 'CAPTURE' FILE!
  98.         *****************************************
  99.              
  100.     And that is what pops up on my screen (all in the space
  101.         of a second or two -- MEX is fast) after bringing up
  102.         MEX.  For me, it's a good reminder.  I have a habit of
  103.         remembering to set up a capture file only after what I
  104.         want to copy has already scrolled by on its way north.
  105.  
  106. ---------------
  107.  
  108. GET.MEX
  109.  
  110.    GET.MEX reads like this:
  111.  
  112.     WRT
  113.     SENDOUT "XMODEM S {1}
  114.     RT {1}
  115.  
  116.    If I type "GET ANYFILE" <cr> on the MEX command line, MEX
  117. will first WRT the capture file, if there is one, to the disk.
  118. (If you don't WRT the capture file before R or S, you'll lose
  119. it) It will then send "XMODEM S ANYFILE" to the host, wait for
  120. a reply and then go into MEX's command mode to give the order
  121. "RT ANYFILE"  When the transfer it completed I'll be left in
  122. the Terminal mode, which in this case is where I want to be.
  123.  
  124.        ALL THIS UNATTENDED, WHILE YOU FILE YOUR NAILS
  125.        OR GO FOR COFFEE.   MAIN ADVANTAGE IS ACCURACY, THOUGH,
  126.        AND SPEED IN TRANSFERING.
  127.  
  128. ---------------
  129.  
  130. GETBYE.MEX
  131.  
  132.    My GETBYE.MEX goes like this:
  133.  
  134.     WRT
  135.     SENDOUT "XMODEM S {1}
  136.     R {1}
  137.     SENDOUT "BYE ^M"
  138.  
  139.    Invoked by "GETBYE ANYFILE.TYP" this will do the same as GET.MEX
  140. but go to the command mode after the transfer in order to send 
  141. the "BYE" command (you can't send sendout commands in anything
  142. but the command mode--it took me some frustrating hours to
  143. realize this).   In other words, it automatically logs off.
  144.  
  145. ---------------
  146.  
  147. GETLIB.MEX
  148.  
  149.    This one reads as follows:
  150.  
  151.     WRT
  152.     SENDOUT "XMODEM L {1} {2}
  153.     RT {2}
  154.  
  155.     
  156.    Invoked by GETLIB ANYFILE THISFILE.DOC, it will download the
  157. member THISFILE.DOC from ANYFILE.LBR.
  158.  
  159. ---------------
  160.  
  161. SEND.MEX
  162.  
  163.    SEND.MEX is just like GET.MEX except that the R's and S's
  164. are transposed, since the purpose of "SEND ANYFILE.TYP" is to
  165. send a file to the host rather than receive one.
  166.  
  167. ---------------
  168.  
  169. Q.MEX is invoked simply by typing "Q" <cr> at the command line.
  170. It reads like this:
  171.  
  172.     STAT REPLY 0
  173.     SENDOUT "ATM0^M"
  174.     STAT REPLY 8
  175.  
  176.    The critical instruction is the second line, which instructs
  177. the Smartmodem to shut down its speaker.  Nice when lines are
  178. busy and you are going into continuous redialing.  The first
  179. and third lines of this file shut off the echoing and waiting
  180. in this process, making it virtually instantaneous and neat --
  181. but restore the normal parameters at completion of the order.
  182.  
  183. ---------------
  184.  
  185. Z.MEX is just like Q.MEX except that the second line reads
  186.  
  187.     SENDOUT "ATZ^M"
  188.  
  189. restoring the Smartmodem to its normal chatty mode.
  190.  
  191. ---------------
  192.  
  193. ADDENDUM:
  194.  
  195. Two other STAT adjustments will make all the above operate more
  196. smoothly.  CLONE these into your version of MEX -- or include
  197. them in your INI.MEX file.
  198.  
  199.     STAT SEARCH 2
  200.     ALT A0
  201.  
  202. The first of these, STAT SEARCH 2, sets up a search path that
  203. orders MEX to look first on the default drive for .MEX files
  204. you indicate and then, failing to find them there, to search
  205. the "Alternate" drive.
  206.  
  207. The second command sets the alternate drive to be A0, which is
  208. right for me, since I am usually logged on B.  Depending on
  209. your system, ALT could be anything.  The combination thus
  210. searches both drives, relieving you of the bother of
  211. remembering which file is on which drive--a kind of internal
  212. ZCPR. 
  213.  
  214. I do hope this exercise will turn out to be useful, perhaps
  215. instigate an exchange of more imaginative .MEX files.  Mex is
  216. dynamically programmable and there may be as many different
  217. ways of programming it as there are users.
  218.  
  219.                     - Irv Block
  220.                       Sea Cliff, NY
  221.                       June 7, 1984