home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / PASCAL / MISCTI10.ZIP / TI205.ASC < prev    next >
Encoding:
Text File  |  1988-04-18  |  30.5 KB  |  1,157 lines

  1. PRODUCT : TURBO EDITOR TOOLBOX     NUMBER : 205
  2. VERSION : 1.00B & 1.00C
  3.      OS : PC-DOS
  4.    DATE : August 20, 1986
  5.  
  6.   TITLE : UPDATE TO VERSION 1.01A
  7.  
  8.                             CONTENTS
  9.  
  10.          Replace EditReformat             Pages  2 - 9
  11.  
  12.          Underline ON/OFF Toggle          Pages 10 - 11
  13.  
  14.          Flush Printer Buffer             Pages 12 - 13
  15.  
  16.          Tab Patch                        Page 14
  17.  
  18.          Memory Allocation Update         Page 15
  19.  
  20.          Restore Screen Update            Pages 16 - 17
  21.  
  22.          Erase String Update              Pages 18 - 19
  23.  
  24.          Accepting Path Names             Pages 20 - 21
  25.  
  26.          Word Wrap Update                 Pages 22 - 23
  27.  
  28.          Intent Text Update               Pages 24 - 25
  29.  
  30.          Block Copy Heap Corruption       Pages 26 - 28
  31.  
  32.          Prevent File Truncation          Pages 29 - 31
  33.             when printing
  34.  
  35.          Saving Text Format Settings      Pages 31 - 33
  36.  
  37.  
  38.  
  39. The  following  is  a  complete  replacement  for  the  procedure 
  40. EditReformat in the Turbo Editor Toolbox.   Note,  this procedure 
  41. exists in the two files:
  42.  
  43.   CMD.ED - .COM  Files, Toolbox Source Diskette
  44.   CMD.MS - Microstar Source Diskette
  45.  
  46. The  procedure enables the user to reformat paragraphs that  were 
  47. created without word wrap on.  Reformatting is terminated by  a 
  48. blank  line instead of a "hard" return. 
  49.  
  50. 1. Load the file CMD.ED into the TURBO editor
  51. 2. Search for the procedure EditDownLine
  52. 3. Move  the procedure  EditDownLine to  the top of the  file  by      
  53. doing a block move.
  54. 4. Comment  out  the old version of the procedure EditReformat by    
  55. placing an open comment '(*' before the procedure and a  close    
  56. comment '*)' at the end of the procedure.
  57. 5. Type in the following procedure:
  58.  
  59. overlay procedure EditReformat;
  60.  
  61. {  This  routine reformats text lines to fit within  the  current 
  62. margins by moving  words to lower lines or  bringing words up
  63. from  lower  lines.  This starts at the current  line,  and  
  64. continues  until  the  end  of the text stream,  or until an
  65. empty  line  is  encountered. }
  66.  
  67. var
  68.   Pcol         : integer;
  69.   Endcol       : integer;
  70.   p            : Plinedesc;
  71.   q            : Plinedesc;
  72.   Reformatting : boolean;
  73.  
  74.   function EmptyLine(Lp : Plinedesc) : boolean;
  75.   {  Checks  to see if a line is empty.   We  use  this  function      
  76. instead  of the wrapped flag to determine when to  terminate      
  77. reformatting. }
  78.  
  79.  
  80.     var
  81.       Pcol : integer;
  82.  
  83.     begin {EmptyLine of EditReformat}
  84.       EmptyLine := true;
  85.       with Lp^ do
  86.       for Pcol := 1 to BuffLen do
  87.         if Txt^ [Pcol] <> ' ' then
  88.         begin
  89.           EmptyLine := false;
  90.           exit;
  91.         end;
  92.     end;  {EmptyLine of EditReformat}
  93.  
  94.   procedure EditCompressLine (Lp : Plinedesc);
  95.   { Changes all multiple spaces to single spaces in the
  96.     text buffer pointed to by the argument. This makes
  97.     the line chopping and appending algorithms
  98.     simpler and more understandable.  }
  99.  
  100.   var
  101.     i : integer;
  102.     j : integer;
  103.  
  104.   begin {EditCompressLine of EditReformat}
  105.     i := Lp^.BuffLen;
  106.     while (i > 1) and (Lp^.Txt^ [i] = ' ') do
  107.       i := Pred (i);
  108.     if i = 1 then
  109.       exit; {This means the line is entirely blank}
  110.     j := 1;
  111.     while (Lp^.Txt^ [j] = ' ') do  {Trim leading spaces}
  112.       j := Succ(j);
  113.     if j > 1 then
  114.     begin
  115.       move (Lp^.Txt^ [j], Lp^.Txt^ [1], Succ(Lp^.BuffLen - j));
  116.       fillchar (Lp^.Txt^ [Lp^.Bufflen - j + 2], Pred(j), ' ');
  117.       i := Succ(i - j);
  118.     end;
  119.  
  120.      REPLACE EDITREFORMAT
  121.  
  122.     j := 2;
  123.     while j < (i-1) do
  124.     begin
  125.       if (Lp^.Txt^ [Succ (j)] = ' ') and (Lp^.Txt^ [j] = ' ')
  126. then
  127.       begin  {We found at least two spaces in a row}
  128.         move (Lp^.Txt^ [Succ (j)], Lp^.Txt^ [j], i - j);
  129.         Lp^.Txt^ [i] := ' ';
  130.         i := Pred(i);   {Goal has shifted to the left one col}
  131.       end
  132.       else
  133.         j := Succ(j);                 {Just a single space}
  134.     end;
  135.   end; {EditCompressLine of EditReformat}
  136.  
  137.   procedure EditShiftLine (Lp : Plinedesc);
  138.   { Ensures that the text in the buffer pointed
  139.     to by the argument has spaces in columns to
  140.     the left of Lmargin.  That makes the other
  141.     procedures easier to write. }
  142.  
  143.   var
  144.     i : integer;
  145.  
  146.   begin {EditShiftLine of EditReformat}
  147.     with Curwin^ do
  148.       if Lmargin > Lp^.BuffLen then
  149.         if not EditSizeline (Lp, Lmargin) then
  150.         begin
  151.           EditErrormsg (35);
  152.           Reformatting := false;
  153.           exit;
  154.         end;
  155.     i := 1;
  156.     with Curwin^ do
  157.       while (i < Lmargin) and (Lp^.Txt^ [i] = ' ') do
  158.         i := Succ (i);
  159.     if Lp^.Txt^ [i] = ' ' then
  160.       exit;    {Stuff before Lmargin is spaces}
  161.     if not EditSizeline(Lp, Lp^.BuffLen + Curwin^.Lmargin - i)
  162. then
  163.     begin
  164.       EditErrormsg (35);
  165.       Reformatting := false;
  166.       exit;
  167.     end;
  168.  
  169.  
  170.  
  171.     with Curwin^ do
  172.       move (Lp^.Txt^ [i], Lp^.Txt^ [Lmargin], Lp^.BuffLen -
  173. Lmargin + i);
  174.     Fillchar (Lp^.Txt^ [1], Pred (Curwin^.Lmargin), ' ')
  175.   end; {EditShiftLine of EditReformat}
  176.  
  177.   procedure EditLongline;
  178.   { Handles the case where the current line contains
  179.     too much text for the current margins.  Here we
  180.     chop off the offending text and make a new line
  181.     for it, which in turn will be reformatted. It's
  182.     here that we have to worry about words too long
  183.     for current margins. }
  184.   begin  {EditLongline}
  185.     Pcol := Curwin^.Rmargin;
  186.     if p^.Txt^ [Curwin^.Rmargin] = ' ' then
  187.       while (p^.Txt^ [Pcol] = ' ') and (Pcol < p^.BuffLen) do
  188.         Pcol := Succ (Pcol)
  189.     else
  190.     begin
  191.       while (p^.Txt^ [Pcol] <> ' ') and (Pcol > Curwin^.Lmargin)
  192. do
  193.         Pcol := Pred (Pcol);
  194.       if (Pcol = Curwin^.Lmargin) and (p^.Txt^ [Pcol] <> ' ')
  195. then
  196.       begin
  197.         EditErrormsg (25);
  198.         Reformatting := false;
  199.         exit;
  200.       end;
  201.       Pcol := Succ (Pcol);
  202.     end;
  203.     q := p^.Fwdlink; {q points to line that was
  204.                       originally after p, if any}
  205.     p^.Fwdlink := EditMaktxtdes(Succ(Curwin^.Lmargin + Endcol -
  206. Pcol));
  207.     if p^.Fwdlink = nil then  { make new line for overflow }
  208.     begin
  209.       EditErrormsg (35);
  210.       Reformatting := false;
  211.       exit;
  212.     end;
  213.  
  214.  
  215.     p^.Fwdlink^.Fwdlink := q;
  216.     p^.Fwdlink^.Backlink := p;
  217.     if q <> nil then
  218.       q^.Backlink := p^.FwdLink;
  219.     with Curwin^ do
  220.       Move (p^.Txt^ [Pcol], p^.Fwdlink^.Txt^ [Lmargin],
  221.             Endcol - Pcol + 1);
  222.     Fillchar (p^.Txt^ [Pcol], Succ (Endcol - Pcol), ' ');
  223.     p := p^.Fwdlink; {point p at line we just created.
  224.                       q is next line, if any}
  225.   end; {EditLongline of EditReformat}
  226.  
  227.   procedure EditShortline;
  228.   { Handles the case where p points to a line
  229.     shorter than Rmargin. That means we have to
  230.     attempt to move some of the text from the line
  231.     pointed to by q into the current line. If q is
  232.     nil or that line is spacefilled, we stop the
  233.     reformat. }
  234.  
  235.   var
  236.     r : Plinedesc;
  237.     i : integer;
  238.  
  239.   begin {EditShortline of EditReformat}
  240.     if q = nil then
  241.     begin
  242.       Reformatting := false;
  243.       exit;
  244.     end;
  245.     if EmptyLine(q) then
  246.     begin
  247.       Reformatting := false;
  248.       exit;
  249.     end;
  250.     i := Curwin^.Lmargin;
  251.     while (i < Pred(Curwin^.Lmargin + Curwin^.Rmargin - Endcol))
  252. and
  253.           (q^.Txt^ [i] <> ' ')  do
  254.       i := Succ (i);
  255.     if (q^.Txt^ [i] <> ' ') then
  256.     begin     {Word wouldn't fit, so advance to next line}
  257.       p := p^.Fwdlink;
  258.       if p = q then q := q^.Fwdlink;
  259.     end
  260.  
  261.  
  262.       else
  263.       if not EditSizeline (p, Succ (Endcol + i -
  264. Curwin^.Lmargin)) then
  265.       begin
  266.         EditErrormsg (35);
  267.         Reformatting := false;
  268.         exit;
  269.       end
  270.       else
  271.       begin                     {Bring up a word from q}
  272.         Move (q^.Txt^ [Curwin^.Lmargin], p^.Txt^ [Endcol + 2],
  273.               i - Curwin^.Lmargin);
  274.         Fillchar (q^.Txt^ [Curwin^.Lmargin], i - Curwin^.Lmargin,
  275. ' ');
  276.         if EmptyLine(q) then { Delete q if now empty }
  277.         begin
  278.           if q^.Backlink = nil then
  279.           begin
  280.             Reformatting := False;
  281.             exit;
  282.           end
  283.           else
  284.             if q^.Fwdlink = nil then
  285.             begin
  286.               q^.Backlink^.Fwdlink := nil;
  287.               EditDelline (q);
  288.               Reformatting := false;
  289.               exit;
  290.             end;
  291.           q^.Backlink^.Fwdlink := q^.Fwdlink;
  292.           q^.Fwdlink^.Backlink := q^.Backlink;
  293.           r := q^.Fwdlink;
  294.           EditDelline (q);
  295.           q := r;
  296.         end;
  297.       end;
  298.   end; {EditShortline of EditReformat}
  299.  
  300. begin {EditReformat}
  301.   EditUpdphyscr; {Print "wait" on command line}
  302.   with Curwin^ do
  303.   begin
  304.     if EmptyLine(CurLine) then
  305.     begin                             {If this line is empty,}
  306.       EditDownline;                   {go to next line and quit}
  307.       Colno := 1;
  308.       exit;
  309.     end;
  310.  
  311.  
  312.     EditChangeFlag := true;
  313.     p := Curline;
  314.     Pcol := Colno;
  315.     q := Curline^.Fwdlink;
  316.     Reformatting := true;   {Any routine turns this off to quit}
  317.     while Reformatting do
  318.     begin
  319.       Curline := p;
  320.       Colno := Pcol;
  321.       EditCompressLine (p); {Delete multiple space areas from
  322. line}
  323.       EditShiftLine (p);    {Start it at Lmargin}
  324.       if q <> nil then
  325.       begin
  326.         EditCompressLine (q);
  327.         EditShiftLine (q)
  328.       end;
  329.       Endcol := p^.BuffLen; {Determine if it's too long or short}
  330.       while (Endcol > Lmargin) and (p^.Txt^ [Endcol] = ' ') do
  331.         Endcol := Pred (Endcol);
  332.       if Endcol > Rmargin then
  333.         EditLongline
  334.       else
  335.         if Endcol < Rmargin then
  336.           EditShortline
  337.         else
  338.         begin
  339.           p := p^.Fwdlink;
  340.           if q = p then q := q^.Fwdlink
  341.         end;
  342.         if p = nil then
  343.           Reformatting := false
  344.         else
  345.           if EmptyLine(p) then
  346.             Reformatting := false
  347.           else
  348.             if Abortcmd then
  349.               Reformatting := false;
  350.     end;
  351.     if Curline^.FwdLink <> nil then
  352.     begin
  353.       Curline := Curline^.FwdLink;
  354.       Colno := 1;
  355.     end
  356.  
  357.  
  358.     else
  359.       EditEndLine;
  360.   end; {with}
  361.   UpdCurFlag := true;
  362.   EditRealign;               {We've really changed things}
  363. end; {EditReformat}
  364.  
  365.  
  366. 6.  Save  the new version of the procedure EditReformat to a file     
  367. by doing a block write.
  368. 7.  Load  the file  CMD.MS into the TURBO editor and comment  out     
  369. the  old version of the procedure EditReformat. (See step 4)
  370. 8.  Read  in  the  new version of the procedure  EditReformat  by     
  371. doing a block read.
  372.  
  373.  
  374.      UNDERLINE ON/OFF TOGGLE
  375.  
  376. The  changes   to  the  Turbo Editor Toolbox  described  in  this 
  377. handout   enable you to print underlined text after the underline 
  378. attribute has been turned on then back off.
  379.  
  380.   The routine to be modified is called:
  381.  
  382.     procedure Translate (var Ch : char);
  383.  
  384.   This routine exists in the file:
  385.  
  386.     PRINT.MS - MicroStar Source diskette
  387.  
  388.  
  389. The modified  code is listed in the routine below with a comment
  390. at the  end of the line: { Ver. 1.01A - ... }.
  391.  
  392. NOTES:
  393.  
  394.    1.  These  modifications will update Turbo Editor  Toolbox  to
  395.        version 1.01A.  Therefore,  you need to update the version
  396.  
  397.    2.  Make   these   modifications  on  a  COPY  of  the  master
  398.        diskettes, do NOT modify your master diskettes.
  399.  
  400.  
  401.  
  402.  
  403.   The  following  are step-by-step instructions  for  making  the
  404.   modifications:    
  405.  
  406.     1. Load the file PRINT.MS into the Turbo Pascal editor.
  407.     2. In the procedure, translate,
  408.  
  409.        Change from:
  410.          .
  411.          .
  412.          .
  413.       19: if UndScore then                     { Underlining
  414. toggle }
  415.             begin
  416.               Ch := #27;
  417.               pushchar(#0);
  418.               pushchar('-');
  419.             end
  420.           else
  421.          .
  422.          .
  423.          .
  424.  
  425.       Change to:
  426.          .
  427.          .
  428.          .
  429.       19: if UndScore then                    { Underlining
  430. toggle }
  431.             begin
  432.               Ch := #27;
  433.               pushchar(#0);
  434.               pushchar('-');
  435.               UndScore := false;            { Ver. 1.01A Addition
  436. }
  437.             end
  438.           else
  439.          .
  440.          .
  441.          .
  442.  
  443.  
  444.  
  445. The  following  modifications  cause  the printer  buffer  to  be 
  446. flushed after finding the end of a print file.  This ensures that 
  447. the  last line of a file will be printed even if it has not  been 
  448. terminated with a return.
  449.  
  450. The routines to be modified are called:  
  451.  
  452.       procedure Translate 
  453.       procedure PrintChar
  454.  
  455. In the file PRINT.MS - MicroStar Source Diskette
  456.  
  457. 1. Load the file PRINT.MS into the Turbo Pascal editor.
  458. 2. In the procedure Translate
  459.  
  460.    Change from:
  461.         .
  462.         .
  463.         .
  464.           end;
  465.     end {case}
  466. end; {Translate}
  467.  
  468.    Change to:
  469.         .
  470.         .
  471.         .
  472.           end;
  473.       26: begin             { ver. 1.01A addition }
  474.             Ch := #13;      { ver. 1.01A addition }
  475.             pushchar(#10);  { ver. 1.01A addition }
  476.           end;              { ver. 1.01A addition }
  477.     end {case}
  478. end; {Translate}
  479.  
  480.  
  481.  
  482. 3. In the procedure PrintChar
  483.  
  484.    Change from:
  485.         .
  486.         .
  487.         .
  488.   if PrintBufferPtr = 128 then
  489.   begin
  490.     if eof(PrintFile) then  { if end of source then call }
  491.  
  492.  
  493.    Change to:
  494.         .
  495.         .
  496.         .
  497.   if (PrintBufferPtr = 128) or { if buffer is empty then }
  498.                                { ver. 1.01A modification }
  499.      (PrintBuffer[PrintBufferPtr] = #0) then { ver. 1.01A
  500. addition }
  501.   begin
  502.     fillchar(PrintBuffer,sizeof(PrintBuffer),#0);
  503.                                { ver. 1.01A addition }
  504.     if eof(PrintFile) then     { if end of source then call }
  505.  
  506. 4.  In the procedure PrintChar
  507.  
  508.     Delete the following statements:
  509.  
  510.   if ch = #$1A then { check for end of file } 
  511.                     { ver. 1.01A deletion }
  512.   begin             { ver. 1.01A deletion }
  513.     PrintExit;      { ver. 1.01A deletion }
  514.     exit;           { ver. 1.01A deletion }
  515.   end;              { ver. 1.01A deletion }
  516.  
  517. 5. Exit the Turbo Pascal editor and save the file.
  518.  
  519.      TAB PATCH
  520.  
  521. This patch enables the tab function to operate correctly when the 
  522. cursor is in Tabposition -1.
  523.  
  524. NOTE:  The modifications to the code are connoted by the comment:
  525.  
  526.                 { Ver. 1.01A Modification }
  527.  
  528. The routine to be modified is called:
  529.  
  530.       procedure Edittab
  531.  
  532. The routine is located in the files:
  533.  
  534.            CMD.ED, - .COM Files, Toolbox Source Diskette
  535.            FASTCMD.MS - MicroStar Source Diskette
  536.  
  537. 1.  Load the file CMD.ED into the editor.
  538. 2.  In the procedure Edittab:
  539.  
  540.     Change from:
  541.  
  542.     with Curwin^ do
  543.       begin
  544.         c := (Colno div Tabsize) * Tabsize + Succ (Tabsize);
  545.         if (Insertflag = Typeover) or (Colno > Curline^.BuffLen)
  546. then
  547.  
  548.     Change to:
  549.  
  550.     with Curwin^ do
  551.       begin
  552.         c := (pred(Colno) div Tabsize) * Tabsize + Succ
  553. (Tabsize); 
  554.                                       { Ver. 1.01A Modification }
  555.         if (Insertflag = Typeover) or (Colno > Curline^.BuffLen)
  556.         then
  557.  
  558. 3.  Load the file FASTCMD.MS into the editor and repeat step 2.
  559.  
  560.  
  561.     MEMORY ALLOCATION UPDATE
  562.  
  563. The  following patch prevents extra space from being allocated at 
  564. the  end  of  a line when a carriage return is  inserted  in  the 
  565. middle of a line.
  566.  
  567. The routine to be modified is called:
  568.  
  569.    procedure EditNewLine;
  570.  
  571. This routine is in the file:
  572.    
  573.    CMD.ED - .COM files, Toolbox Source Diskette
  574.    FASTCMD.ED - MicroStar Source Diskette
  575.  
  576. The modifications to the code below are indicated by a comment at 
  577. the end of the line:
  578.  
  579.     { Ver. 1.01A modification }
  580.  
  581.  
  582. 1. Load the file CMD.ED into your Turbo Pascal editor.
  583. 2. In the procedure EditNewLine.
  584.  
  585.    Change from:
  586.      while (c > 1) and (p^.Txt^ [c] = ' ') do c := Pred (c);
  587.      L := Succ (p^.BuffLen - Colno);
  588.      if L < 1 then L := 1;
  589.  
  590.    Change to:
  591.      while (c > 1) and (p^.Txt^ [c] = ' ') do c := Pred (c);
  592.      L := Succ (c - Colno);   { ver. 1.01A modification }
  593.      if L < 1 then L := 1;
  594.  
  595. 3. Exit the editor and save the file.
  596. 4. Load the file FASTCMD.MS into the Turbo Pascal editor and
  597. repeat
  598.    steps 2 and 3.
  599.  
  600.  
  601.  
  602.      SCREEN RESTORE UPDATE
  603.  
  604. The  change to the Turbo Editor Toolbox described in this section 
  605. enables  Microstar to restore the screen after escaping from  the 
  606. copy file command.
  607.  
  608. The routine to be modified is called:
  609.  
  610.    overlay procedure CopyFile;
  611.  
  612. This routine is in the file:
  613.  
  614.    MSCMD.MS - MicroStar Source Diskette
  615.  
  616. The modifications to the code below are indicated by a comment at
  617. the end of the line:
  618.  
  619.     { Ver. 1.01A - modification }
  620.  
  621.  
  622. NOTES:
  623.  
  624.  
  625.      2.  Make  these   modifications  on  a COPY  of  the  master         
  626. diskette - do NOT modify your master diskettes.
  627.  
  628.  
  629.      SCREEN RESTORE UPDATE
  630.  
  631. The  following  are  step-by-step  instructions  for  making  the
  632. modification:
  633.  
  634.      1.  Load the file MSCMD.MS into the Turbo Pascal editor.
  635.  
  636.      2.  In the procedure Copyfile, Change from:
  637.             .
  638.             .
  639.             .
  640.  
  641.     If Target = #27 then Target := '';
  642.     if (Target = '') or (Target = Source) then
  643.       exit;
  644.  
  645.     MenuColor := WLowColor;  { valid target file, already exists?
  646.             .
  647.             .
  648.             .
  649.  
  650.          Change to:
  651.             .
  652.             .
  653.             .
  654.  
  655.     If Target = #27 then Target := '';
  656.     if (Target = '') or (Target = Source) then
  657.     begin                                  { vs 1.01A addition }
  658.       RestoreWindow(cl,ln,wd,hg);          { vs 1.01A addition }
  659.       
  660.     exit;
  661.     end;                                   { vs 1.01A addition }           
  662.     MenuColor := WLowColor;  { valid target file, already exists?
  663. }        
  664.             .
  665.             .
  666.             .
  667.  
  668.  
  669.      ERASE STRING UPDATE
  670.  
  671. The  change to the Turbo Editor Toolbox described in this section 
  672. enables  MicroStar  to erase a string correctly  when  the  first 
  673. character is entered for a new string.  
  674.  
  675. The routine to be modified is called:
  676.  
  677.    function GetString;
  678.  
  679. This routine is in the file:
  680.  
  681.    SCREEN.MS - MicroStar Source Diskette
  682.  
  683. The modifications to the code below are indicated by a comment at
  684. the end of the line:
  685.  
  686.     { Ver. 1.01A - modification }
  687.  
  688.  
  689. NOTES:
  690.  
  691.  
  692.      2.  Make  these   modifications  on  a COPY  of  the  master         
  693. diskettes  -  do NOT modify your master diskettes.
  694.  
  695.       ERASE STRING UPDATE 
  696.  
  697. The  following  are  step-by-step  instructions  for  making  the
  698. modification:
  699.  
  700.      1.  Load the file SCREEN.MS into the Turbo Pascal editor.
  701.      2.  In the function GetStringChange from:
  702.             .
  703.             .
  704.             .
  705.       if (ch in CharFilter) and (byte(St[0]) < Maxlen) then
  706.         begin                      { check that character is
  707. legal }
  708.           if newstr then
  709.             .
  710.             .
  711.             .
  712.  
  713.  
  714.          Change to:
  715.             .
  716.             .
  717.             .
  718.       if (ch in CharFilter) then             {vs 1.01A
  719. modification}
  720.         if (byte(St[0]) < Maxlen) or NewStr then {vs 1.01A
  721. addition}
  722.         begin                       { check that character is
  723. legal }
  724.           if newstr then
  725.             .
  726.             .
  727.             .
  728. ..end
  729.  
  730.  
  731.  
  732.      ACCEPTING PATH NAMES
  733.  
  734. The  change to the Turbo Editor Toolbox described in this section 
  735. enables Microstar to accept path names when specifying a file  to 
  736. print.  
  737.  
  738. The routine to be modified is called:
  739.  
  740.    overlay procedure Printinit;                              
  741.  
  742. This routine is in the file:
  743.  
  744.    MSCMD.MS  - MicroStar Source Diskette
  745.  
  746. The modifications to the code below are indicated by a comment at
  747. the end of the line:
  748.  
  749.     { Ver. 1.01A - modification }
  750.  
  751.  
  752. NOTES:
  753.  
  754.  
  755.      2.  Make  these   modifications  on  a COPY  of  the  master         
  756. diskettes  -  do NOT modify your master diskettes.
  757.  
  758.  
  759.  
  760.      ACCEPTING PATH NAMES
  761.  
  762. The  following  are  step-by-step  instructions  for  making  the
  763. modification:
  764.  
  765. 1.  Load the file MSCMD.MS into the Turbo Pascal editor.
  766.  
  767. 2.  In the procedure PrintInit, Change from
  768.        .
  769.        .
  770.        .
  771.     SetmemAddress(cl + 2, ln + 1);
  772.     Writestring(prompt);
  773.     CharFilter := ['0'..'9','@'..'Z',':','.','_','$'];
  774.     MenuColor := WNormColor;
  775.     PrintFilename := GetString(cl + 27,ln +
  776. 1,40,PrintFilename,true);
  777.  
  778.     Change to:
  779.        .
  780.        .
  781.        .
  782.     SetmemAddress(cl + 2, ln + 1);
  783.     Writestring(prompt);
  784.     CharFilter := ['0'..'9','@'..'Z',':','.','_','$','\','_'];
  785.                           { vs 1.01A modification }
  786.     MenuColor := WNormColor;
  787.     PrintFilename := GetString(cl + 27,ln +
  788. 1,40,PrintFileName,true);
  789.  
  790.  
  791.      WORD WRAP UPDATE
  792.  
  793. The change to the Turbo Editor Toolbox described in this  section
  794. prevents MicroStar from losing the second half of a line when the 
  795. left and right margins are set and word wrap is on.
  796.  
  797. The routine to be modified is called:
  798.    
  799.    overlay procedure EditCenterLine;
  800.  
  801. This routine is in the file:
  802.  
  803.    OCMD.MS - MicroStar Source Diskette
  804.  
  805. There is only one modification to be made to the code below.   It 
  806. is listed with a comment at the end of the line:
  807.  
  808.     { Ver. 1.01A - modification }
  809.  
  810.  
  811. NOTES:  
  812.  
  813.  
  814.      2.  Make  these   modifications  on  a COPY  of  the  master                   
  815. diskettes  -  do NOT modify your master diskettes.
  816.   
  817. The  following  are  step-by-step  instructions  for  making  the 
  818. modification:
  819.  
  820.      1.  Load the file OCMD.MS into the Turbo Pascal editor.
  821.      2.  In the procedure EditCenterLine, Change from:
  822.          
  823.             .
  824.             .
  825.             .
  826.          Disp := Succ((Llen - Tlen) div 2);
  827.          if not EditSizeline(Curline,Succ(Disp + Tlen)) then
  828.          begin
  829.  
  830.      WORD WRAP UPDATE 
  831.             .
  832.             .
  833.             .
  834.          Change to:
  835.             .
  836.             .
  837.             .
  838.          Disp := Succ((Llen - Tlen) div 2);
  839.          if not EditSizeline(Curline,Succ(Disp + Llen)) then 
  840.          { Ver. 1.01A - Modification }
  841.          begin
  842.             .
  843.             .
  844.             .
  845.  
  846.      INDENT TEXT UPDATE
  847.  
  848. The  changes  to Turbo Editor Toolbox described in  this  section 
  849. enable the Turbo Editor Toolbox to correctly indent text when the 
  850. left margin has been set and a <Return> is inserted in the middle 
  851. of a line.
  852.  
  853. The routine to be modified is called:
  854.      
  855.      procedure EditNewLine;
  856.  
  857. This routine is in two files:
  858.     
  859.      FASTCMD.MS - Microstar Source Diskette
  860.      CMD.ED - .COM files, Toolbox Source Diskette
  861.  
  862. The modified lines of code are listed in the routine below with a 
  863. comment at the end of the line (Ver.  1.01A - ...).   The comment 
  864. indicates  when  the  code  is  an  addition,   deletion,   or  a 
  865. modification.   
  866.  
  867.  
  868. NOTES:  
  869.  
  870.  
  871.  
  872.      2.  Make  these   modifications  on  a COPY  of  the  master                   
  873. diskettes  -  do NOT modify your master diskettes.
  874.  
  875.     INDENT TEXT 
  876.  
  877. The  following  are  step-by-step  instructions  for  making  the 
  878. modifications:
  879.  
  880.      1.  Load the file CMD.ED into the Turbo Pascal editor.
  881.  
  882.      2.  In the procedure EditNewLine, Change from:
  883.             .
  884.             .
  885.             .
  886.          L := Succ (p^.BuffLen - Colno);
  887.          if L < 1 then L := 1;
  888.          if not EditSizeline (Curline, L) then
  889.          begin
  890.            EditErrormsg (35);
  891.            EditRealign;
  892.            exit
  893.          end;
  894.  
  895.          if c >= Colno then
  896.          begin
  897.            Move (p^.Txt^ [Colno], Curline^.Txt^ [l], L);
  898.            Fillchr (p^.Txt^ [Colno], L, ' ')
  899.          end;
  900.              .
  901.              .
  902.              .
  903.       Change to:
  904.              .
  905.              .
  906.              .
  907.          L := Succ (C - Colno);       {Ver. 1.01A Modification}
  908.          if L < 1 then L := 1;
  909.          if  not  EditSizeline(Curline,L + Lmargin) then { Ver. 
  910.          1.01A - modification }
  911.          Begin
  912.            EditErrormsg (35);
  913.            EditRealign;
  914.            exit
  915.          end;
  916.          if c >= Colno then
  917.    INDENT TEXT
  918.  
  919.          begin
  920.            fillchar(Curline^.txt^[1],L  +  Lmargin,' ');   {Ver.            
  921. 1.01A - addition }
  922.            Move(p^.Txt^ [Colno],  Curline^.Txt^ [Lmargin],  L); 
  923.            {Ver. 1.01A - modification }
  924.            Fillchar (p^.Txt^ [Colno], L, ' ')
  925.          end;
  926.  
  927.              .
  928.              .
  929.              .
  930.  
  931.      3.  Load the file FASTCMD.MS into the Turbo Pascal editor.
  932.      4.  Repeat step 2
  933.  
  934.  
  935.      BLOCK COPY HEAP CORRUPTION UPDATE
  936.  
  937. The changes to the Turbo Editor Toolbox described in this section 
  938. are  to  prevent the corruption  of the heap when doing  a  block 
  939. copy.
  940.  
  941. The routine to be modified is called:
  942.  
  943.      procedure EditBlockCopy
  944.  
  945. This routine is in two files:
  946.  
  947.      KCMD.MS - MicroStar Source Diskette
  948.      KCMD.ED .COM files, Toolbox Source Diskette
  949.  
  950. The modified lines of code are listed in the routine below with a 
  951. comment at the end of the line (Ver.  1.01A - ...).   The comment 
  952. indicates  when  the  code  is  an  addition,   deletion,   or  a 
  953. modification.   
  954.  
  955.  
  956. NOTES:
  957.  
  958.  
  959.      2.  Make  these   modifications  on  a COPY  of  the  master         
  960. diskettes  -  do NOT modify your master diskettes.
  961.  
  962.  
  963. The  following  are  step-by-step  instructions  for  making  the 
  964. modifications:
  965.  
  966.      1.  Load the file KCMD.ED into the Turbo Pascal editor.
  967.      2.  In the procedure EditBlockCopy, Change from:
  968.             .
  969.             .
  970.             .
  971.  
  972.      BLOCK COPY HEAP CORRUPTION UPDATE 
  973.  
  974.          with Curwin^ do
  975.            begin
  976.              Match := true;
  977.              for i := 1 to Curline^.Bufflen do
  978.                if Curline^.Txt^ [i] <> ' ' then Match := false;
  979.              if (Curline^.Backlink = nil) and 
  980.                 (Curline^.Fwdlink = nil) and Match then
  981.            
  982.            begin                        { copy first record }
  983.              Move (p^.Txt^, Curline^.Txt^, p^.Bufflen);
  984.              Curline^.Fwdlink := p^.Fwdlink;
  985.              Curline^.Flags := p^.Flags;
  986.              u := p^.Fwdlink;
  987.              EditDestxtdes (p);
  988.              if u <> nil then
  989.                u^.Backlink := Curline
  990.            end
  991.  
  992.              .
  993.              .
  994.              .
  995.          Change to:
  996.              .
  997.              .
  998.              .
  999.            with Curwin^ do
  1000.            begin
  1001.              Match := true;
  1002.              for i := 1 to Curline^.Bufflen do
  1003.                if Curline^.Txt^ [i] <> ' ' then Match := false;
  1004.              if (Curline^.Backlink = nil) and 
  1005.                Curline^.Fwdlink = nil) and Match then
  1006.              begin                     { copy first record}
  1007.                if EditSizeLine(Curline,p^.Bufflen) then  { Ver.
  1008.                1.01A - Addition }
  1009.                begin
  1010.                  Move (p^.Txt^, Curline^.Txt^, p^.Bufflen);
  1011.                  Curline^.Fwdlink := p^.Fwdlink;
  1012.                  Curline^.Flags := p^.Flags;
  1013.                  u := p^.Fwdlink:
  1014.                  EditDestxtdes (p)
  1015.                  if u <> nil then
  1016.                    u^.Backlink := Curline;
  1017.                end                       { Ver. 1.01A - Addition
  1018. }
  1019.    BLOCK COPY HEAP CORRUPTION UPDATE 
  1020.  
  1021.                else                   { Ver. 1.01A - Addition }
  1022.                begin                  { Ver. 1.01A - Addition }
  1023.                  EditErrormsg (35);   { Ver. 1.01A - Addition }
  1024.                  exit;                { Ver. 1.01A - Addition }
  1025.                end;                   { Ver. 1.01A - Addition }
  1026.              end
  1027.                .
  1028.                .
  1029.                .
  1030.      
  1031.      3.  Load the file KCMD.MS into the Editor.
  1032.      4.  Repeat step 2.
  1033.  
  1034.  
  1035.  
  1036.      PREVENTS FILE TRUCATION WHEN PRINTING
  1037.  
  1038. The  changes  to the ETBX in this section prevent MicroStar  from 
  1039. truncating the end of a file when it is printed.
  1040.  
  1041. The modified lines of code are listed in the routines below  with 
  1042. a comment at the end of the line {Ver.  1.01A - ...}. The comment 
  1043. indicates when the code is an addition deletion or modification.
  1044.  
  1045. Notes:
  1046.  
  1047.  
  1048.      2.  Make  these   modifications  on  a COPY  of  the  master         
  1049. diskettes  -  do NOT modify your master diskettes.
  1050.  
  1051. 1. Load the file VARS.MS into the TURBO PASCAL editor.
  1052.  
  1053. 2. Add a global variable to the file:
  1054.  
  1055.     PrintFileSize : real; { Ver. 1.01A Addition }
  1056.  
  1057. 3. Save  the  file  VARS.MS and Load the file MSCMD.MS  into  the    
  1058. editor. 
  1059.  
  1060. 4. At line 40 in the code:
  1061.  
  1062.    Change from:
  1063.      Reset(PrintFile);
  1064.  
  1065.    Change to:
  1066.      Reset(PrintFile,1);  { Ver. 1.01A Modification }
  1067.  
  1068. 5. At line 45 in the code insert the statement:
  1069.  
  1070.      PrintFileSize := LongFileSize(PrintFile);
  1071.  
  1072.  
  1073. 6. Save  the  file MSCMD.MS and Load the file PRINT.MS  into  the    
  1074. editor. 
  1075.  
  1076. 7. At line 137 in the code:
  1077.  
  1078.    PREVENTS END OF FILE TRUCATION WHEN PRINTING 
  1079.  
  1080.    Change from:
  1081.      BlockRead(PrintFile, PrintBuffer, 1);
  1082.  
  1083.    Change to:
  1084.      if PrintFileSize >= 128 then      {Ver. 1.01A Addition}
  1085.      begin
  1086.        blockread(PrintFile,PrintBuffer,128); {Ver. 1.01A
  1087. Modification}
  1088.        PrintFileSize := PrintFileSize - 128; {Ver. 1.01A
  1089. Addition}
  1090.      end                                     {Ver. 1.01A
  1091. Addition}
  1092.      else                                    {Ver. 1.01A
  1093. Addition}
  1094.        blockread(PrintFile,PrintBuffer,trunc(PrintFileSize));
  1095.                                              {Ver. 1.01A
  1096. Addition}
  1097.  
  1098.  
  1099.  
  1100.      SAVING TEXT FORMAT SETTINGS
  1101.  
  1102. The  changes   to  the  Turbo Editor Toolbox  described  in  this 
  1103. handout  correct  the  Save  Default  Settings  command  so  that 
  1104. MicroStar will properly initialize the settings the user saves.
  1105.  
  1106.   The routine to be modified is called:
  1107.  
  1108.     function EditCrewindow(Top:integer;Len:integer;Fn:varstring;
  1109.                            Cr:integer;Cc:integer):Pwindesc;
  1110.  
  1111.   This routine exists in the file:
  1112.  
  1113.      USER.MS - MicroStar Source Diskette
  1114.  
  1115. The  modified  lines  of code are  listed in  the  routine  below 
  1116. with a comment at the  end of the line: { Ver. 1.01A - ... }. The 
  1117. comment indicates when the code is an addition, a deletion, or  a 
  1118. modification.  
  1119.  
  1120. NOTES:
  1121.  
  1122.     
  1123.    2.  Make   these   modifications  on  a  COPY  of  the  master               
  1124. diskettes, do NOT modify your master diskettes.
  1125.  
  1126.   The  following  are step-by-step instructions  for  making  the  
  1127. modifications:
  1128.  
  1129.     1. Load the file USER.MS into the Turbo Pascal editor.
  1130.  
  1131.  
  1132.      SAVING DAFAULT TEXT FORMAT SETTINGS
  1133.  
  1134.   In the function EditCreWindows, Change from:
  1135.          .
  1136.          .
  1137.     Filename := Fn;
  1138.     Insertflag := Insert;
  1139.     WW := false;
  1140.     AI := false;
  1141.     Firstlineno := Top;
  1142.          .
  1143.          .
  1144.  
  1145.   Change To:
  1146.          .
  1147.          .
  1148.     Filename := Fn;
  1149.     Insertflag := InsFlag(InsertDef);  { modified ver. 1.01A }
  1150.     WW := WordWpDef;                   { modified ver. 1.01A }
  1151.     AI := AutoInDef;                   { modified ver. 1.01A }
  1152.     Firstlineno := Top;
  1153.          .
  1154.          .
  1155.  
  1156.