home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / editor / gal210a4.arc / GALCH6.GAL < prev    next >
Text File  |  1987-07-27  |  17KB  |  548 lines

  1. .a  lp=12,js=y,ct=n bo=51 te=12 to=90 nm=1 pn=1
  2. .st3,14,1
  3. &dChapter%Six:%%Programming%Galahad .jc
  4. &d[%Chapter%Six%]  .hc
  5. .t36 6 - .zl
  6.  
  7.  
  8.  
  9. &d6.1%INTRODUCTION .jr
  10.  
  11. .sto3,11,1
  12. NOTE: Most Galahad users will have no need to program Galahad and therefore do
  13. not need to read this chapter.  However, if you would like to customize the
  14. word processor to your own particular uses, you will learn most of what you
  15. need from the next few pages.
  16. .st3,11,1
  17.  
  18.  
  19.      Galahad II is a highly programmable word processor.  This means that you
  20. can create functions and assign them to particular keys.  You can even make
  21. your changes a permanent part of Galahad so that your special key assignments
  22. are activated automatically, whenever you invoke Galahad at the MS-DOS A>
  23. prompt.
  24.  
  25.  
  26.  
  27. .st3,14,1
  28.                     &d6.2%TEMPORARY%ASSIGNMENTS .jr
  29.  
  30. .st3,11,1 .x-5
  31.  
  32. .st3,12,1
  33. &dThe%Read%Command
  34. .st3,11,1
  35.      Not every Galahad command is tied to a key.  As we saw in Chapter Five,
  36. commands such as DefaultExtension must be entered at the Command prompt.  It is
  37. possible to assign such commands to a key temporarily.  Such temporary key
  38. assignments last until you exit Galahad, or until you reassign the key:
  39.  
  40. .std3,12,1
  41. PROCEDURE FOR ASSIGNING KEYS (Temporarily) .jc
  42. .st3,11,1
  43. .i10
  44. .u3 1. .t10 On an empty screen (use NEW Command if your screen has text) enter
  45. a list of key assignments with this syntax:
  46.  
  47.         key==command;
  48.  
  49.  
  50.      -"key" is the key assignment
  51.      -"command" is the Galahad command
  52.      -the assignment ends with a semicolon and carriage return
  53.  
  54. .u3 2. .t10 Display the Command prompt
  55.  
  56. .u3 3. .t10 Enter the command
  57.  
  58.         ReadInitBuffer
  59.  
  60. .i
  61.  
  62.      The listed key assignment will be made.  Keys not listed will remain as
  63. they were.  Check Appendix F for a list of the Galahad Default Key assignments.
  64. These are the key assignments described in this manual.  Use them as examples
  65. for making your own key assignments.  You may also use the Help Command and the
  66. CDFIMOSW keys (or see Appendix E) for a list of Galahad commands.
  67.  
  68.  
  69.      If a key assignment is written improperly the following message appears:
  70.  
  71.         Error in init file!
  72.  
  73. The the abbreviation &iinit&s. stands for &iinitialization&s.  Notice that you
  74. can save your key assignments in a file for use whenever you need them.  If you
  75. do save an assignment file, be sure to give it the following extension:
  76.  
  77.         =.INI
  78.  
  79.  
  80. Files with this extension are called &iinitialization &ifiles&n.
  81.  
  82.  
  83.  
  84.  
  85. .st3,12,1
  86. &dSample%Key%Assignments
  87. .st3,11,1 .x-5
  88.      Suppose you would like to change a number of letters in your text to
  89. uppercase regardless of their current case.  The easiest way would be to assign
  90. the UpperCase function to a key.  To do so place the following command on a
  91. blank screen:
  92.  
  93.     sF8==UpperCase;
  94.  
  95.  
  96. Use the "Procedure for Assigning Keys;" to assign the UpperCase command to
  97. <%SHIFT%>%<%F8%>.  The assignment is made immediately.  When you press
  98. <%SHIFT%>%<%F8%> the UpperCase command will be performed.  Try it on some text
  99. with mixed uppercase and lowercase.  Notice the difference between the new
  100. <%SHIFT%>%<%F8%> and <%F10%> (ChangeCase).
  101.  
  102.  
  103.      This single key assignment can be saved as a file for use on another day.
  104. If you do save it, be sure to use a =.INI extension.
  105.  
  106.  
  107.      Before we continue we need a little lesson about the key names which are
  108. acceptable to the ReadInitBuffer function for key assignment.  Consider the
  109. following examples:
  110. .n10
  111.  
  112. .t12 _Key .t29 _Key%Name .t45 _Restrictions
  113.  
  114. <F1> .y1,20 .t30  F1
  115. <KP1> .y1,20 .t30  KP1
  116. <1> .y1,20 .t30  "1"
  117. <a> .y1,20 .t30  "a"
  118. <G> .y1,20 .t30  "G"
  119. <SHIFT> <F6> .y2,20 .t30  sF6
  120. <CTRL> <B> .y2,20 .t30  ^B .t40 Only Uppercase Letters Allowed
  121. <CTRL> <F8> .y2,20 .t30  mCF8 .t40 Only Function Keys -- Not Keypad
  122. <ALT> <a> .y2,20 .t30   mA"a" .t40 Only Lowercase Letters and Numbers
  123. <ALT> <F2> .y2,20 .t30  mAF2 .t40 Only Function Keys -- Not Keypad
  124. .i
  125.  
  126.  
  127.  
  128. .st3,12,1
  129. &dReassigning%Keys
  130. .st3,11,1 .x-5
  131.      The preceding example assigned UpperCase to a key, <%SHIFT%><%F8%>, which
  132. had the previous key assignment of ToggleSplit.  ToggleSplit is no longer
  133. assigned to a key.  There may be times that you simply want to change the
  134. current assignment to different key.
  135.  
  136.      As an example, assume that we want to exchange <%F9%> and <%F10%>.
  137.  
  138. To exchange these assignment enter two commands in your initialization file:
  139.  
  140.     F9==ChangeCase;
  141.     F10==TransposeChars;
  142.  
  143. By adding more and more key reassignments you can change the entire keypad, but
  144. remember to keep track of the changes you make.  If your temporary changes get
  145. out of control you can always exit Galahad and start over again.
  146.  
  147.      You can see that your assignment have taken effect simply by entering the
  148. HELP command (or <%SHIFT%>%<%KP5%>).  Then press the newly assigned keys and
  149. see which functions are assigned to the keys.
  150.  
  151.  
  152. .sto3,11,1
  153. NOTE:   This manual describes only a default set of key assignments.  Be sure
  154. to keep track of any reassignments that you make.
  155.  
  156.  
  157.  
  158.  
  159. .st3,12,1
  160. &dMeta-Key%Assignments
  161. .st3,11,1
  162.      Initial key assignment in Galahad, that is, the functions described in
  163. Chapters One through Five, were designed for the convenience of the word
  164. processor user.  As a rule of thumb, don't change keys that have already been
  165. assigned.  For instance, it is probably best to leave the ChangeCase function
  166. bound to <%F10%>.
  167.  
  168.      So that the user can make new key assignments without changing existing
  169. assignments, Galahad provides the Meta-Key.  The Meta-Key is bound to <%ESC%>
  170. on the numeric keypad.  In Chapter One you saw how to configure Galahad for
  171. various printers by using <%ESC%> <p>.  You can assign any key in the same
  172. Esc--Key sequence by entering the letters M1 before the key in your key
  173. assignment.  Consider the following key assignments:
  174.  
  175.  
  176.     M1F1==UpperCase;
  177.     M1F2==ChangeCase;
  178.  
  179. With these assignments you can press <%ESC%> <%F1%> then change a character to
  180. uppercase.  The <%F1%> key by itself will retain its ordinary function.  To
  181. change the case of a letter you can press either <F10>, which remains
  182. unchanged, or <%ESC%> <%F2%>.  The <%F2%> key by itself will remain unchanged.
  183.  
  184.  
  185. .sto3,11,1
  186. NOTE:  When <%ESC%> is pressed, the message: Meta Active - Press Companion Key
  187. appears on the lower left of the screen.
  188. .st3,11,1
  189.  
  190.  
  191.      The standard Galahad described in this manual also assigns a special
  192. function to <%ESC%> <%TAB%>.  The <%ESC%> <%TAB%> sequence places five blank
  193. spaces on the line.  This function is useful for indenting paragraphs.
  194.  
  195.      Ordinarily <%TAB%> moves the carriage to the next tabulation.  Tabulations
  196. are 8 spaces apart at columns 1, 9, 17, 25, 33, and so forth.  But <%ESC%>
  197. <%TAB%> simply adds five spaces to the line without moving to any absolute
  198. tabulation column.
  199.  
  200.  
  201.      To see which Meta keys have been assigned in the standard Galahad press
  202. <%ESC%> <m>.
  203.  
  204.  
  205.      Consider the following key assignments:
  206.  
  207.     M1F1==UnderscoreCursor;
  208.     M1F2==ChangeCase;
  209.     M1F3=="%%%%%%%%%%";
  210.     M1"9"==DisplayString "Hello There.";
  211.  
  212. The first two we have discussed.  <%ESC%> <%F3%> now inserts 10 blank spaces at
  213. the cursor position and <%ESC%> <%F9%> displays the message "Hello There" on a
  214. separate screen--a screen that functions much as a Help text.
  215.  
  216.  
  217.      Notice that the 9 is in quotes.  Any of the typewriter keyboard keys must
  218. be entered in quotes.  To assign the left parenthesis mark, just above the 9,
  219. put it in quotes too, as in
  220.  
  221.         M1"("=="message";
  222.  
  223. Using quotes around the keys also enables you to distinguish between upper and
  224. lower case letters, as in <C> and <c>.  Consider the following example:
  225.  
  226.  
  227.     M1F1==UnderscoreCursor;
  228.     M1F2==ChangeCase;
  229.     M1F3=="%%%%%%%%%%";
  230.     M1"9"==DisplayString "Hello There.";
  231.     M1"C"=="     Clarkson Clarkson Clarkson Clarkson Clarkson Clarkson
  232.          Clarkson Clarkson Clarkson Clarkson Clarkson Clarkson ";
  233.     M1"c"==DisplayString "This is lower case d.";
  234.  
  235. Here uppercase C, that is <%ESC%> <%SHIFT%> <C>, is assigned to display the two
  236. lines in quotes.  Such lines might be used as your personal letterhead.  Notice
  237. that the key assignment takes two lines.  Any number of lines might be entered
  238. between quotation marks as long as the assignment ends with a semicolon.  If
  239. you were writing a number of letters you might want to use this capability to
  240. assign your inside address to a Meta-Key.
  241.  
  242.  
  243.  
  244.  
  245. .st3,12,1
  246. &dThe%HELP%Text
  247. .st3,11,1
  248.      Once you have used the Read command, any newly assigned keys will be
  249. reflected in the Help screens.  For instance, use Read to assign the following
  250. keys:
  251.  
  252.  
  253.     M1F1==UnderscoreCursor;
  254.     M1F2==ChangeCase;
  255.     M1F3=="%%%%%%%%%%";
  256.  
  257.  
  258.  
  259.      Now when <%SHIFT%> <%KP5%> (HELP) is pressed then <%ESC%>, the following
  260. is displayed:
  261.  
  262. .rh1,78
  263.    =.......
  264.  
  265.    =.......
  266.  
  267.    Press any key for help or CDFIMOSW for categories of help
  268.    Pressing the Esc key will Meta Key "1"
  269.  
  270.  
  271.    Enter a key to describe (Space to exit, Help for menu) ?
  272. .rh1,78
  273.  
  274. Figure 6.1 HELP (<%SHIFT%> <%KP5%>)  <%ESC%> .jc
  275.  
  276. .g
  277. When HELP (<%SHIFT%> <%KP5%>) <%ESC%> <%F3%> is pressed, the following is
  278. displayed:
  279.  
  280. .rh1,78
  281.    Press any key for help or CDFIMOSW for categories of help
  282.    Pressing the Home key will Meta Key "1"
  283.    Pressing the M1F3 key will "%%%%%%%%%%"
  284.  
  285.  
  286.  
  287.    Enter a key to describe (Space to exit, Help for menu) ?
  288. .rh1,78
  289.  
  290. Figure 6.2 <HELP> (<%SHIFT%> <%KP5%>) <%ESC%> <%F3%> .jc
  291.  
  292.  
  293.      Automatic HELP is particularly useful when you forget which key you have
  294. assigned to which function.
  295.  
  296.  
  297.  
  298.  
  299. .st3,12,1
  300. &dMultiple%Function%Assignments
  301. .st3,11,1
  302.      The ReadInitBuffer command allows the user to assign multiple functions to
  303. a single key.  For instance, suppose that you typed in the following message
  304. before realizing that you wanted to underline it:
  305.  
  306.  
  307.     Beware of Hidden Rocks Beneath the Boat
  308.  
  309. To underline you can use the arrow keys and underline sign to place the
  310. underline character in front of each word.  Or you might find in more
  311. convenient to assign multiple functions to a single key.  For instance, you
  312. could use the the Read command to make the following key assignment:
  313.  
  314.  
  315.     sF8==MoveWordRight%%MoveWordRight "=_";
  316.  
  317. The first "MoveWordRight" takes the cursor to the end of the word that the
  318. cursor is resting on.  The second takes the cursor through one or more spaces
  319. to the next word.   Here is how your new function works:  Move the cursor to
  320. the "B" in "Beware" and enter an underline mark.
  321.  
  322.  
  323.     =_Beware of Hidden Rocks Beneath the Boat
  324.  
  325. Now each time you press <%SHIFT%> <%F8%> the cursor will move to the next word
  326. and enter an underline.
  327.  
  328.     =_Beware =_of =_Hidden =_Rocks =_Beneath =_the =_Boat
  329.  
  330.  
  331.  
  332.  
  333. Another Example of a Multiple Function Assignment
  334.  
  335.      In the previous chapter we saw how to use <%ESC%> <%F8%>, RecordKey, to
  336. write a dashed line around a line of text.    Here is how we might perform the
  337. same task with the read command:
  338.  
  339.  
  340. sF8==MoveToLeft Moveup .b
  341. "--------------------------WARNING------------------------------" .b
  342. MoveDown MoveDown .b
  343. "------------------------------------------------------------------------" .b
  344. InsertNewLine;
  345.  
  346.  
  347.  
  348.      Now enter the message:
  349.  
  350.         Beware of Hidden Rocks Beneath the Boat
  351.  
  352.  
  353.      While the cursor is on the same line press <%SHIFT%> <%F8%>:
  354. .a js=n
  355. --------------------------WARNING------------------------------
  356.      Beware of Hidden Rocks Beneath the Boat
  357. ------------------------------------------------------------------------
  358. .a js=y
  359.  
  360. Study each command of the dashed lines example to see how it was done.
  361.  
  362.  
  363.  
  364.  
  365. .st3,14,1
  366.                     &d6.3%MAKING%YOUR%OWN%GALAHAD .jr
  367.  
  368. .st3,11,1 .x-5
  369.  
  370. .st3,12,1
  371. &dMaking%Your%Changes%Permanent
  372. .st3,11,1
  373.      Any of your key assignments can be saved in an =.INI (initialization) file
  374. and invoked with the ReadInitBuffer command whenever you need them, but you may
  375. want to make a few functions a permanent part of your customized Galahad.  To
  376. do this you will need on your disk:
  377.  
  378.         &h7 GAL2.COM
  379.         &h7 GAL207IP.INI
  380.         &h7 CONFPER.COM
  381.  
  382. Appendix F is a listing of the default initialization file, GAL207IP.INI.  This
  383. file contains almost all the default key assignments and parameters for the
  384. Galahad described in this manual.  See Appendix E for a list of all Gal2
  385. functions.  The program CONFPER.COM combines the initialization file with Gal2
  386. to produce a Galahad that contains all of the key assignments of the
  387. initialization file.
  388.  
  389.  
  390.      To customize Gal2 with your own key assignments:
  391.  
  392. .std3,12,1
  393. PROCEDURE FOR CUSTOMIZING GALAHAD .jc
  394. .st3,11,1
  395. .i10
  396. .u3 1. .t10 Use Gal2 to Load GAL207IP.INI
  397.  
  398. .u3 2. .t10 Add, change, or delete key assignments as you desire
  399.  
  400. .u3 3. .t10 Save your modified file under a new name:
  401.  
  402.     newname.INI
  403.  
  404. .u3 4. .t10 Exit Galahad
  405.  
  406. .u3 5. .t10 From the A: prompt enter CONFPER and follow the prompts, being sure
  407. that you
  408.  
  409.     -enter your new =.INI file name when prompted
  410.     -name your customized Galahad something other than Gal2
  411. .i
  412.  
  413.  
  414.  
  415.      The following dialogue shows how CONFPER.COM operates.
  416.  
  417.  
  418.     _User .t35 _Computer%Prompt
  419.  
  420. Enters
  421.    CONFPER
  422.  .t25 Input Galahad or Percival file name [GAL2.COM]:
  423.  
  424. Presses
  425.    <%RETURN%>
  426.  
  427. .t25 Init file name [DEFAULT.INI]:
  428.  
  429. Enters name of new
  430.  =.INI file or <RETURN>
  431.  if correct
  432.  
  433. .t25 Output Galahad or Percival file name [GAL2.COM]:
  434.  
  435. Enters name of new
  436.  Gal2 or <RETURN>
  437.  if correct
  438.  
  439. .t25 List File [NUL.LST]
  440.  
  441.  
  442. Provides filename
  443.  for error messages
  444.  
  445.  
  446. Be sure to give a name to the List File.  If there is an error message in your
  447. =.INI file, an error message will appear.  You can then look at the last line
  448. of the List File to discover the line containing your error.  Rather than
  449. sending the errors to a file you can use the name CON.  This is print the
  450. errors to the screen.
  451.  
  452.  
  453. .st3,12,1
  454. &dPrinting%Defaults
  455. .st3,11,1
  456.      You can change the printer defaults (margins, page numbers, etc.) of your
  457. customized Galahad by modifying the next to last line of Default.INI.  This is
  458. setting the default values for the dot A command.  From Galahad LOAD
  459. GAL207IP.INI and use <%END%> to move to the bottom of the Edit screen.  The
  460. file will appear similar to Figure 6.3.
  461.  
  462. .rh1,78
  463.  
  464. Init.==
  465. BlockCursor
  466. Options "10" "80" "12"
  467. WindowMargin "10" "10"
  468. NameText "NONAME.GAL"
  469. DisplayString "
  470.                 GALAHAD II
  471.  
  472.     Customed Configured for Operations with a Z-200 in PC Mode
  473.  
  474.  
  475.     To Edit (or Create) Text - Press Alt F3, then Enter; or Ctrl Enter
  476.  
  477.           For HELP press the Shifted KeyPad 5 Key
  478.  
  479. "
  480. DisplayString"      NOTE:  This Galahad is NOT configured for your printer.
  481.          Press ESC p for Temporary Configuration.
  482.          See Appendix D for Permanent Configuration.
  483.  
  484.  
  485. "
  486. PrinterConfig ""
  487. DefaultDotA "HY=N"
  488. LoadCommand;
  489. .rh1,78
  490.  
  491. Figure 6.3  DefaultDotA:  The Next to Last Line of Default.INI  .jc
  492.  
  493.  
  494.      To set default Dot A commands simply enter them inside the double quotes
  495. just after the command DefaultDotA.  You may use more than one line, as long
  496. as you keep your commands between a single set of double quotes.
  497. .n6
  498. The Dot A defaults for Gal2 are as follows:
  499.  
  500.   AD==Y PS==N BH==3 AH==2 BN==2 AN==3 PN==1 LL==78 PL==66 SP==1 LM==0 LP==15
  501.  
  502.   JS==N HY==Y IP==Y SS==Y CL==Y CT==Y AL==N TO==0 TE==0 BO==50 BE==0
  503.  
  504.  
  505. .sto3,11,1
  506. NOTE:  All the functions shown in Figure 6.3 are assigned to
  507.  
  508.         Init.==
  509.  
  510. They end with the single semicolon at the end of the file.  USE ONLY THIS ONE
  511. SEMICOLON.  (Semicolons in sequences are OK as long as they remain inside
  512. quotation marks.)
  513.  
  514.  
  515.  
  516. .st3,12,1
  517. &dDefault%Printer%Configuration
  518. .st3,11,1
  519.      In Chapter One we saw how to configure Galahad for your printer using
  520. <%ESC%> and <p>.  With Confper you can configure Galahad to your printer
  521. automatically, whenever Galahad is invoked.  Note in Figure 6.3 that the
  522. PrinterConfig line is the empty string -- that is there is no printer
  523. configuration. Also, note again that there is only one semicolon in the
  524. figure--all the functions here are assigned to Init.  They are performed when
  525. Galahad is first invoked, from the A: prompt.
  526.  
  527.  
  528.      Scroll up the screen (about 20 lines) until you find the other printer
  529. configuration assignments.  If your printer is not in the file, look on the
  530. disk file PRINTCFG.INI supplied on your Galahad distribution disk.
  531.  
  532.  
  533.      To make your printer configuration automatic:
  534.  
  535. .i10
  536. .u3 1. .t10 Replace the Init. configuration with the configuration that
  537. corresponds to your printer--the printer name appears in the assignment. (Use
  538. <%SHIFT%> <%F9> and <%SHIFT%> <%F10%>)
  539.  
  540. .u3 2. .t10 Change the Init. DisplayString message (see Figure 6.3) so that it
  541. reports the name of your printer.  Your new message will appear each time you
  542. invoke Galahad.
  543.  
  544. .u3 3. .t10 Save your =.INI file under a special name.
  545.  
  546. .u3 4. .t10 Use Confper to create your own Galahad.  You might want to give it
  547. a special name such as Galjuki, or Mygal.
  548.