home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / SUBMIT / SUBMIT.INF < prev    next >
Text File  |  2000-06-30  |  8KB  |  144 lines

  1. TELL YOU KAYPRO TO SUBMIT!
  2.  
  3. by Lindsay Haisley
  4.  
  5.  
  6. There is a program that comes with every CP/M software package, right
  7. along with PIP, ED, STAT, and the others, which has been described as
  8. one of CP/M's best kept secrets.  This program is called SUBMIT.COM, and
  9. proper use of it can save you a lot of time (and the aggravation of
  10. making lots of mistakes) when doing repetitive tasks at the CP/M
  11. operating level.
  12.  
  13. Let's suppose that you are writing a series of after-Christmas "thank
  14. you" notes to all your relatives in College Station.  All the letters
  15. start out with your address and the date and all end with "Love" and
  16. your name.  Now to save time, you have made up a short file containing
  17. your address and the date and another containing "Love" and your name.
  18. You could, of course, use your word processor's "include file" facility
  19. to call in each of these two short files at the appropriate point in
  20. each letter, however for the sake of this example let's assume that your
  21. word processor doesn't have such a facility, and that you have to do the
  22. job on each letter "by hand".  This makes it a truly stupid (and
  23. fictitious) word processor which we shall call STUPIDWP.COM.  Your
  24. address and date are in a file called ADRSDATE and your closing is in a
  25. file called LOVE.
  26.  
  27. You are about to write a thank you to your Aunt Mary for the wool
  28. sweater she sent you which you are going to call AUNTMARY.LET.  To do
  29. the job by hand, start by copying ADRSDATE to your letter using PIP.  At
  30. your CP/M command prompt type "PIP AUNTMARY.LET = ADRSDATE <Return>".
  31. When PIP has finished putting the address and date into your letter,
  32. which it has just created, you can use your word processor to write the
  33. text of the letter.  You type "STUPIDWP AUNTMARY.LET <Return>" and your
  34. word processor logs on and reads in your letter which already has your
  35. address and the date in it.  After you have finished the text of your
  36. letter you tell your word processor to save your work and go back to the
  37. CP/M command level.  You then type "PIP AUNTMARY.LET = AUNTMARY.LET,LOVE
  38. <Return>", and PIP obligingly concatenates your closing onto your
  39. letter.  You then want to move your letter onto your B disk, erase it
  40. from your A disk and look at your directory of files on B to see which
  41. relatives you have already written.  You type, in succession, PIP
  42. B:=A:AUNTMARY.LET <Return>", "ERA A:AUNTMARY.LET <Return>" and "DIR B:
  43. <Return>".
  44.  
  45. Now this is a fair number of CP/M command entries.  Since you will use
  46. almost the same series of CP/M commands for each letter, it is easy to
  47. guess that your computer (which is good at repetitive almost identical
  48. tasks) could be made to automate the process and save you the hassle of
  49. typing all the commands for each letter.  This, indeed, is what
  50. SUBMIT.COM is for.  Before you start typing your letters you will use
  51. your word processor to make up what is called a "submit file".  We will
  52. call this file THANK-U.SUB (submit file names ALWAYS end with SUB), and
  53. it will look like this:
  54.  
  55. PIP $1.LET = ADRSDATE
  56. STUPIDWP $1.LET
  57. PIP $1.LET = $1.LET,LOVE
  58. PIP B: = A:$1.LET
  59. ERA A:$1.LET
  60. DIR B:
  61.  
  62. As you can see, this looks ALMOST like the series of commands which you
  63. typed at the keyboard to accomplish the letter writing job by hand.  You
  64. will note right away, however, that poor AUNTMARY has become simply $1.
  65. To let your computer do the CP/M command job automatically, make sure
  66. that SUBMIT.COM is on your A disk and type "SUBMIT THANK-U AUNTMARY
  67. <Return>".  Your computer will load and execute SUBMIT.COM, which will
  68. in turn look for the file THANK-U.SUB.  SUBMIT will then create its own
  69. little work file called $$$.SUB (If STUPIDWP has a directory listing
  70. facility, you can see this filename in the directory while your are
  71. writing your letter) and will execute each line of THANK-U.SUB exactly
  72. as if you had typed it at the keyboard, substituting "AUNTMARY" for
  73. every occurrence of "$1".  The "$1" is called a "formal parameter" and
  74. you may use as many of them as you need ($2, $3 and etc.) in a submit
  75. file as long as each formal parameter is matched by a character or group
  76. of characters on your command line following the name of your submit
  77. file.  After this letter is finished you may type "SUBMIT THANK-U
  78. UNCLJOHN <Return>" and repeat the process for a letter to your uncle.
  79. Slick?  I guess so!!
  80.  
  81. You can include any command in a submit file which you would normally
  82. enter at your CP/M command prompt.  SUBMIT will not, however, give
  83. commands to a program once that program has taken over control of your
  84. computer from your CP/M command processor.  If this seems like a
  85. disadvantage to you, rest assured that it also gave a pause for thought
  86. to the programmers at Digital Research, and so they created a program
  87. called XSUB.COM to enable you to give commands TO A PROGRAM from a
  88. submit file.  If you include the command "XSUB" in a submit file (or
  89. enter it from your keyboard) XSUB will place a short program in an
  90. out-of-the-way portion of your computer memory, and until your next
  91. keyboard initiated warm boot every program in your submit file which
  92. requires keyboard input will take it's input from your submit file
  93. instead.  Thus, you might have a submit file, lets call it SEE.SUB, to
  94. use DDT (The Dynamic Debugging Tool included with your CP/M software)
  95. which looks like this:
  96.  
  97. XSUB
  98. DDT $1
  99. D0100
  100. G0
  101. SAVE 10 $1
  102.  
  103. Typing "SUBMIT SEE FOO.TXT <Return>" at your CP/M command prompt will
  104. first RUN XSUB and then load DDT, which will in turn read FOO.TXT into
  105. memory.  Because XSUB has been run, DDT will get its commands from the
  106. SEE.SUB instead of from your keyboard.  The command D0100 is a DDT
  107. command which will display what is in your computer's memory starting at
  108. memory address 100 (the beginning of FOO.TXT), while the command G0
  109. causes DDT to hand control back to CP/M.  The submit file then tells
  110. CP/M to save ten "pages" as the file FOO.TXT.
  111.  
  112. Now SUBMIT.COM has one drawback that is difficult to overcome.  If you
  113. change user areas within a submit file by including the command "USER n"
  114. in the file, CP/M will dutifully change user areas; however it will
  115. leave SUBMIT's $$$.SUB work file behind so that when SUBMIT looks for
  116. the next command to execute it finds itself abandoned and throws up its
  117. hands and quits.  Once again, a group of enterprising young programmers
  118. saw a challenge and rose to meet it.  The result was a public domain
  119. program called EX14.COM, which keeps it's command information in memory
  120. instead of in a disk file.  It also combines the functions of SUBMIT and
  121. XSUB which saves disk space and is quite convenient.  EX14.COM has been
  122. around for a few years, and you will find it, along with its DOC file in
  123. most user's group libraries (including the KCA's).
  124.  
  125. Murphey's law still haunts us, however.  As fine a program as EX14 is,
  126. it has one drawback.  Because it includes the capabilities of XSUB, it
  127. will ALWAYS try feed characters from the current submit file to whatever
  128. program is running every time that program expects keyboard input.
  129. Thus, if we were to try to run our THANK-U.SUB program under EX14, we
  130. would find our word processor reading the lines of our submit file into
  131. our letter instead of waiting for us to type input from the keyboard.
  132. Aunt Mary would be very puzzled indeed!
  133.  
  134. Very recently a SUBMIT style program has come on the public domain scene
  135. which gives us the option of telling the computer when to pause for
  136. keyboard input and when to get its input from a submit file.  This
  137. program, by Erik Ganz, is called GSUB.COM, and seems to be the Last Word
  138. in using CP/M's submit capabilities.  The KCA library will soon have
  139. this file, and you will find it in the B0 section of the KCA RCP/M,
  140. along with a short DOC file.  If you use submit files at all, I suggest
  141. that you give this one a try.
  142.  
  143. - Kaypro Club Austin
  144.