home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / lambda / soundpot / f / gsub10.lbr / GSUB.DZC / GSUB.DOC
Encoding:
Text File  |  1993-10-26  |  4.4 KB  |  131 lines

  1. ;;05-26-85
  2.  
  3.                           GSUB.DOC v1.0
  4.                             05/25/85
  5.  
  6. Eric Gans
  7. French Dep't UCLA
  8. Los Angeles, CA 90024
  9.  
  10.      Why add another entry to the already crowded field of SUBMIT 
  11. substitutes?   Why not use EX?   EX is a powerful program, but it 
  12. has  a major defect:  it can't distinguish between console  input 
  13. within  a program and input to the CCP.   Thus it can't run a SUB 
  14. file  that  contains  a series of programs one  of  which  allows 
  15. console  input;  it just reads the rest of the SUB file into  the 
  16. program.   For  example,  I  use a little file Z.SUB for  writing 
  17. assembly language programs:   
  18.                               ws $1.azm
  19.                               z80mr $1.bbz
  20.                               mload $1
  21.  
  22. EX can't handle this;  as soon as it gets into Wordstar it writes 
  23. the other two lines into my source file instead of waiting to get 
  24. back to the console.  GSUB was written to solve this problem.
  25.  
  26.      GSUB,  like EX, puts its command buffer in memory instead of 
  27. in a $$$.SUB disk file.  It allows:
  28.  
  29. - internal program input separate from CCP input 
  30. - run from command line or SUB file
  31. - variables ($1 - $9)
  32. - control characters
  33. - wait for console input
  34. - comments
  35.  
  36.      It  is  also smaller & faster than EX (or  any  other  batch 
  37. program I have seen).   It not only traps Warm Boots but  returns 
  38. to  the end rather than the beginning of the CCP (saves a  second 
  39. of looking on disk for $$$.SUB files).  Its command buffer allows 
  40. 256 characters (comments not included),  or two sectors; v1.0x is 
  41. 40-50 characters larger.
  42.  
  43. Command syntax:
  44.  
  45. (1)  Command line:  to run GSUB without a SUB file (for  one-time 
  46. use) you enter the command line as follows:
  47.  
  48. gsub =cmd1[;{internal program commands}][cmd2][;...
  49.  
  50. CCP  commands (except the last in line) must be followed by  ";", 
  51. and internal commands must be within "{...}"
  52.  
  53. $<ch>  will  take  <ch> as a literal (i.e.,  to use  "{"  in  the 
  54. command line, write "${")
  55. ^<ch> will produce a control character
  56.  
  57. Internal Commands (within {...})
  58.  
  59. | = carriage return (0Dh = ^m)
  60. ~ waits for a character input
  61.  
  62. Examples: gsub =ws;{nblurk.azm^m}era *.bak   will enter WS & open 
  63. the  non-document  file  blurk.azm,  then on exit erase  the  BAK 
  64. file(s)
  65.           
  66. gsub =ddt;{dd200|lea00~s100|42|4c|55|52|4b|.|^c}save 1 blurk
  67.  
  68. will  enter ddt,  dump d200-,  write out the command "lea00"  and 
  69. wait for you to type a key (e.g., a CR), then display the byte at 
  70. 100H and enter five characters and a "." to end, exit with ^C and 
  71. save  the result.   Note that except for the wait for input,  the 
  72. second  example  might  have  been  accomplished  (several  times 
  73. slower)  with SUBMIT and XSUB,  but not the first,  since "n"  in 
  74. Wordstar  is a character input that does not use CPM function  10 
  75. (read console buffer). 
  76.  
  77.  
  78. (2) File input:
  79.  
  80. Variables:  as in normal SUB files,  variables should be numbered 
  81. consecutively from $1 to $9. 
  82.  
  83. Each CCP command must be followed by a CRLF.   Internal  commands 
  84. may include CRLF's also;  usually a CR alone (|)  suffices.   The 
  85. internal command line, if any, must end with a CRLF.
  86.  
  87. Comment  lines  beginning  with  ";" will not be  copied  to  the 
  88. command  buffer.   You may also add comments after the end of the 
  89. internal command line.
  90.  
  91. $<ch>  will  produce  a  literal of <ch>  for  anything  but  the 
  92. variables $1-$9.
  93.  
  94. Otherwise, the $, ^, | and ~ symbols function as above.
  95.  
  96. Examples:
  97.  
  98. ws
  99. {nblurk.azm|}
  100. era *.bak
  101.  
  102.  
  103. ddt
  104. { .... } (as above)
  105. save 1 blurk
  106. [eof]
  107.  
  108. Another  way of entering a CR into the internal input is to go to 
  109. the  next  line;  the  program kills the LF's  that  are  usually 
  110. misinterpreted  by  word-processors &  other  programs  (Wordstar 
  111. thinks you want to set the help level (^J):
  112.  
  113. ;for the literary
  114. ws charlott.let
  115. {Liebchen, I can't live without you.
  116. Death is my only recourse.
  117. ;don't believe a word - The Editor
  118.  - Werther
  119. ^kx}  ;pretty hot stuff?
  120.  
  121. To  output control characters etc.  to the screen,  enter them as 
  122. external commands (NOT within {...}):
  123.  
  124. gsub =^g^z^[B0^[=00BLURK!^[C0^m
  125.  
  126. will sound the bell (^g),  then (on an ADM 3A) blank the  screen, 
  127. set  inverse  video,  go sixteen lines down and  sixteen  across, 
  128. print BLURK!,  then turn off inverse video and do a CR (you can't 
  129. use | here).
  130.  
  131.