home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-04-18 | 30.5 KB | 1,157 lines |
- PRODUCT : TURBO EDITOR TOOLBOX NUMBER : 205
- VERSION : 1.00B & 1.00C
- OS : PC-DOS
- DATE : August 20, 1986
-
- TITLE : UPDATE TO VERSION 1.01A
-
- CONTENTS
-
- Replace EditReformat Pages 2 - 9
-
- Underline ON/OFF Toggle Pages 10 - 11
-
- Flush Printer Buffer Pages 12 - 13
-
- Tab Patch Page 14
-
- Memory Allocation Update Page 15
-
- Restore Screen Update Pages 16 - 17
-
- Erase String Update Pages 18 - 19
-
- Accepting Path Names Pages 20 - 21
-
- Word Wrap Update Pages 22 - 23
-
- Intent Text Update Pages 24 - 25
-
- Block Copy Heap Corruption Pages 26 - 28
-
- Prevent File Truncation Pages 29 - 31
- when printing
-
- Saving Text Format Settings Pages 31 - 33
-
-
-
- The following is a complete replacement for the procedure
- EditReformat in the Turbo Editor Toolbox. Note, this procedure
- exists in the two files:
-
- CMD.ED - .COM Files, Toolbox Source Diskette
- CMD.MS - Microstar Source Diskette
-
- The procedure enables the user to reformat paragraphs that were
- created without word wrap on. Reformatting is terminated by a
- blank line instead of a "hard" return.
-
- 1. Load the file CMD.ED into the TURBO editor
- 2. Search for the procedure EditDownLine
- 3. Move the procedure EditDownLine to the top of the file by
- doing a block move.
- 4. Comment out the old version of the procedure EditReformat by
- placing an open comment '(*' before the procedure and a close
- comment '*)' at the end of the procedure.
- 5. Type in the following procedure:
-
- overlay procedure EditReformat;
-
- { This routine reformats text lines to fit within the current
- margins by moving words to lower lines or bringing words up
- from lower lines. This starts at the current line, and
- continues until the end of the text stream, or until an
- empty line is encountered. }
-
- var
- Pcol : integer;
- Endcol : integer;
- p : Plinedesc;
- q : Plinedesc;
- Reformatting : boolean;
-
- function EmptyLine(Lp : Plinedesc) : boolean;
- { Checks to see if a line is empty. We use this function
- instead of the wrapped flag to determine when to terminate
- reformatting. }
-
-
- var
- Pcol : integer;
-
- begin {EmptyLine of EditReformat}
- EmptyLine := true;
- with Lp^ do
- for Pcol := 1 to BuffLen do
- if Txt^ [Pcol] <> ' ' then
- begin
- EmptyLine := false;
- exit;
- end;
- end; {EmptyLine of EditReformat}
-
- procedure EditCompressLine (Lp : Plinedesc);
- { Changes all multiple spaces to single spaces in the
- text buffer pointed to by the argument. This makes
- the line chopping and appending algorithms
- simpler and more understandable. }
-
- var
- i : integer;
- j : integer;
-
- begin {EditCompressLine of EditReformat}
- i := Lp^.BuffLen;
- while (i > 1) and (Lp^.Txt^ [i] = ' ') do
- i := Pred (i);
- if i = 1 then
- exit; {This means the line is entirely blank}
- j := 1;
- while (Lp^.Txt^ [j] = ' ') do {Trim leading spaces}
- j := Succ(j);
- if j > 1 then
- begin
- move (Lp^.Txt^ [j], Lp^.Txt^ [1], Succ(Lp^.BuffLen - j));
- fillchar (Lp^.Txt^ [Lp^.Bufflen - j + 2], Pred(j), ' ');
- i := Succ(i - j);
- end;
-
- REPLACE EDITREFORMAT
-
- j := 2;
- while j < (i-1) do
- begin
- if (Lp^.Txt^ [Succ (j)] = ' ') and (Lp^.Txt^ [j] = ' ')
- then
- begin {We found at least two spaces in a row}
- move (Lp^.Txt^ [Succ (j)], Lp^.Txt^ [j], i - j);
- Lp^.Txt^ [i] := ' ';
- i := Pred(i); {Goal has shifted to the left one col}
- end
- else
- j := Succ(j); {Just a single space}
- end;
- end; {EditCompressLine of EditReformat}
-
- procedure EditShiftLine (Lp : Plinedesc);
- { Ensures that the text in the buffer pointed
- to by the argument has spaces in columns to
- the left of Lmargin. That makes the other
- procedures easier to write. }
-
- var
- i : integer;
-
- begin {EditShiftLine of EditReformat}
- with Curwin^ do
- if Lmargin > Lp^.BuffLen then
- if not EditSizeline (Lp, Lmargin) then
- begin
- EditErrormsg (35);
- Reformatting := false;
- exit;
- end;
- i := 1;
- with Curwin^ do
- while (i < Lmargin) and (Lp^.Txt^ [i] = ' ') do
- i := Succ (i);
- if Lp^.Txt^ [i] = ' ' then
- exit; {Stuff before Lmargin is spaces}
- if not EditSizeline(Lp, Lp^.BuffLen + Curwin^.Lmargin - i)
- then
- begin
- EditErrormsg (35);
- Reformatting := false;
- exit;
- end;
-
-
-
- with Curwin^ do
- move (Lp^.Txt^ [i], Lp^.Txt^ [Lmargin], Lp^.BuffLen -
- Lmargin + i);
- Fillchar (Lp^.Txt^ [1], Pred (Curwin^.Lmargin), ' ')
- end; {EditShiftLine of EditReformat}
-
- procedure EditLongline;
- { Handles the case where the current line contains
- too much text for the current margins. Here we
- chop off the offending text and make a new line
- for it, which in turn will be reformatted. It's
- here that we have to worry about words too long
- for current margins. }
- begin {EditLongline}
- Pcol := Curwin^.Rmargin;
- if p^.Txt^ [Curwin^.Rmargin] = ' ' then
- while (p^.Txt^ [Pcol] = ' ') and (Pcol < p^.BuffLen) do
- Pcol := Succ (Pcol)
- else
- begin
- while (p^.Txt^ [Pcol] <> ' ') and (Pcol > Curwin^.Lmargin)
- do
- Pcol := Pred (Pcol);
- if (Pcol = Curwin^.Lmargin) and (p^.Txt^ [Pcol] <> ' ')
- then
- begin
- EditErrormsg (25);
- Reformatting := false;
- exit;
- end;
- Pcol := Succ (Pcol);
- end;
- q := p^.Fwdlink; {q points to line that was
- originally after p, if any}
- p^.Fwdlink := EditMaktxtdes(Succ(Curwin^.Lmargin + Endcol -
- Pcol));
- if p^.Fwdlink = nil then { make new line for overflow }
- begin
- EditErrormsg (35);
- Reformatting := false;
- exit;
- end;
-
-
- p^.Fwdlink^.Fwdlink := q;
- p^.Fwdlink^.Backlink := p;
- if q <> nil then
- q^.Backlink := p^.FwdLink;
- with Curwin^ do
- Move (p^.Txt^ [Pcol], p^.Fwdlink^.Txt^ [Lmargin],
- Endcol - Pcol + 1);
- Fillchar (p^.Txt^ [Pcol], Succ (Endcol - Pcol), ' ');
- p := p^.Fwdlink; {point p at line we just created.
- q is next line, if any}
- end; {EditLongline of EditReformat}
-
- procedure EditShortline;
- { Handles the case where p points to a line
- shorter than Rmargin. That means we have to
- attempt to move some of the text from the line
- pointed to by q into the current line. If q is
- nil or that line is spacefilled, we stop the
- reformat. }
-
- var
- r : Plinedesc;
- i : integer;
-
- begin {EditShortline of EditReformat}
- if q = nil then
- begin
- Reformatting := false;
- exit;
- end;
- if EmptyLine(q) then
- begin
- Reformatting := false;
- exit;
- end;
- i := Curwin^.Lmargin;
- while (i < Pred(Curwin^.Lmargin + Curwin^.Rmargin - Endcol))
- and
- (q^.Txt^ [i] <> ' ') do
- i := Succ (i);
- if (q^.Txt^ [i] <> ' ') then
- begin {Word wouldn't fit, so advance to next line}
- p := p^.Fwdlink;
- if p = q then q := q^.Fwdlink;
- end
-
-
- else
- if not EditSizeline (p, Succ (Endcol + i -
- Curwin^.Lmargin)) then
- begin
- EditErrormsg (35);
- Reformatting := false;
- exit;
- end
- else
- begin {Bring up a word from q}
- Move (q^.Txt^ [Curwin^.Lmargin], p^.Txt^ [Endcol + 2],
- i - Curwin^.Lmargin);
- Fillchar (q^.Txt^ [Curwin^.Lmargin], i - Curwin^.Lmargin,
- ' ');
- if EmptyLine(q) then { Delete q if now empty }
- begin
- if q^.Backlink = nil then
- begin
- Reformatting := False;
- exit;
- end
- else
- if q^.Fwdlink = nil then
- begin
- q^.Backlink^.Fwdlink := nil;
- EditDelline (q);
- Reformatting := false;
- exit;
- end;
- q^.Backlink^.Fwdlink := q^.Fwdlink;
- q^.Fwdlink^.Backlink := q^.Backlink;
- r := q^.Fwdlink;
- EditDelline (q);
- q := r;
- end;
- end;
- end; {EditShortline of EditReformat}
-
- begin {EditReformat}
- EditUpdphyscr; {Print "wait" on command line}
- with Curwin^ do
- begin
- if EmptyLine(CurLine) then
- begin {If this line is empty,}
- EditDownline; {go to next line and quit}
- Colno := 1;
- exit;
- end;
-
-
- EditChangeFlag := true;
- p := Curline;
- Pcol := Colno;
- q := Curline^.Fwdlink;
- Reformatting := true; {Any routine turns this off to quit}
- while Reformatting do
- begin
- Curline := p;
- Colno := Pcol;
- EditCompressLine (p); {Delete multiple space areas from
- line}
- EditShiftLine (p); {Start it at Lmargin}
- if q <> nil then
- begin
- EditCompressLine (q);
- EditShiftLine (q)
- end;
- Endcol := p^.BuffLen; {Determine if it's too long or short}
- while (Endcol > Lmargin) and (p^.Txt^ [Endcol] = ' ') do
- Endcol := Pred (Endcol);
- if Endcol > Rmargin then
- EditLongline
- else
- if Endcol < Rmargin then
- EditShortline
- else
- begin
- p := p^.Fwdlink;
- if q = p then q := q^.Fwdlink
- end;
- if p = nil then
- Reformatting := false
- else
- if EmptyLine(p) then
- Reformatting := false
- else
- if Abortcmd then
- Reformatting := false;
- end;
- if Curline^.FwdLink <> nil then
- begin
- Curline := Curline^.FwdLink;
- Colno := 1;
- end
-
-
- else
- EditEndLine;
- end; {with}
- UpdCurFlag := true;
- EditRealign; {We've really changed things}
- end; {EditReformat}
-
-
- 6. Save the new version of the procedure EditReformat to a file
- by doing a block write.
- 7. Load the file CMD.MS into the TURBO editor and comment out
- the old version of the procedure EditReformat. (See step 4)
- 8. Read in the new version of the procedure EditReformat by
- doing a block read.
-
-
- UNDERLINE ON/OFF TOGGLE
-
- The changes to the Turbo Editor Toolbox described in this
- handout enable you to print underlined text after the underline
- attribute has been turned on then back off.
-
- The routine to be modified is called:
-
- procedure Translate (var Ch : char);
-
- This routine exists in the file:
-
- PRINT.MS - MicroStar Source diskette
-
-
- The modified code is listed in the routine below with a comment
- at the end of the line: { Ver. 1.01A - ... }.
-
- NOTES:
-
- 1. These modifications will update Turbo Editor Toolbox to
- version 1.01A. Therefore, you need to update the version
-
- 2. Make these modifications on a COPY of the master
- diskettes, do NOT modify your master diskettes.
-
-
-
-
- The following are step-by-step instructions for making the
- modifications:
-
- 1. Load the file PRINT.MS into the Turbo Pascal editor.
- 2. In the procedure, translate,
-
- Change from:
- .
- .
- .
- 19: if UndScore then { Underlining
- toggle }
- begin
- Ch := #27;
- pushchar(#0);
- pushchar('-');
- end
- else
- .
- .
- .
-
- Change to:
- .
- .
- .
- 19: if UndScore then { Underlining
- toggle }
- begin
- Ch := #27;
- pushchar(#0);
- pushchar('-');
- UndScore := false; { Ver. 1.01A Addition
- }
- end
- else
- .
- .
- .
-
-
-
- The following modifications cause the printer buffer to be
- flushed after finding the end of a print file. This ensures that
- the last line of a file will be printed even if it has not been
- terminated with a return.
-
- The routines to be modified are called:
-
- procedure Translate
- procedure PrintChar
-
- In the file PRINT.MS - MicroStar Source Diskette
-
- 1. Load the file PRINT.MS into the Turbo Pascal editor.
- 2. In the procedure Translate
-
- Change from:
- .
- .
- .
- end;
- end {case}
- end; {Translate}
-
- Change to:
- .
- .
- .
- end;
- 26: begin { ver. 1.01A addition }
- Ch := #13; { ver. 1.01A addition }
- pushchar(#10); { ver. 1.01A addition }
- end; { ver. 1.01A addition }
- end {case}
- end; {Translate}
-
-
-
- 3. In the procedure PrintChar
-
- Change from:
- .
- .
- .
- if PrintBufferPtr = 128 then
- begin
- if eof(PrintFile) then { if end of source then call }
-
-
- Change to:
- .
- .
- .
- if (PrintBufferPtr = 128) or { if buffer is empty then }
- { ver. 1.01A modification }
- (PrintBuffer[PrintBufferPtr] = #0) then { ver. 1.01A
- addition }
- begin
- fillchar(PrintBuffer,sizeof(PrintBuffer),#0);
- { ver. 1.01A addition }
- if eof(PrintFile) then { if end of source then call }
-
- 4. In the procedure PrintChar
-
- Delete the following statements:
-
- if ch = #$1A then { check for end of file }
- { ver. 1.01A deletion }
- begin { ver. 1.01A deletion }
- PrintExit; { ver. 1.01A deletion }
- exit; { ver. 1.01A deletion }
- end; { ver. 1.01A deletion }
-
- 5. Exit the Turbo Pascal editor and save the file.
-
- TAB PATCH
-
- This patch enables the tab function to operate correctly when the
- cursor is in Tabposition -1.
-
- NOTE: The modifications to the code are connoted by the comment:
-
- { Ver. 1.01A Modification }
-
- The routine to be modified is called:
-
- procedure Edittab
-
- The routine is located in the files:
-
- CMD.ED, - .COM Files, Toolbox Source Diskette
- FASTCMD.MS - MicroStar Source Diskette
-
- 1. Load the file CMD.ED into the editor.
- 2. In the procedure Edittab:
-
- Change from:
-
- with Curwin^ do
- begin
- c := (Colno div Tabsize) * Tabsize + Succ (Tabsize);
- if (Insertflag = Typeover) or (Colno > Curline^.BuffLen)
- then
-
- Change to:
-
- with Curwin^ do
- begin
- c := (pred(Colno) div Tabsize) * Tabsize + Succ
- (Tabsize);
- { Ver. 1.01A Modification }
- if (Insertflag = Typeover) or (Colno > Curline^.BuffLen)
- then
-
- 3. Load the file FASTCMD.MS into the editor and repeat step 2.
-
-
- MEMORY ALLOCATION UPDATE
-
- The following patch prevents extra space from being allocated at
- the end of a line when a carriage return is inserted in the
- middle of a line.
-
- The routine to be modified is called:
-
- procedure EditNewLine;
-
- This routine is in the file:
-
- CMD.ED - .COM files, Toolbox Source Diskette
- FASTCMD.ED - MicroStar Source Diskette
-
- The modifications to the code below are indicated by a comment at
- the end of the line:
-
- { Ver. 1.01A modification }
-
-
- 1. Load the file CMD.ED into your Turbo Pascal editor.
- 2. In the procedure EditNewLine.
-
- Change from:
- while (c > 1) and (p^.Txt^ [c] = ' ') do c := Pred (c);
- L := Succ (p^.BuffLen - Colno);
- if L < 1 then L := 1;
-
- Change to:
- while (c > 1) and (p^.Txt^ [c] = ' ') do c := Pred (c);
- L := Succ (c - Colno); { ver. 1.01A modification }
- if L < 1 then L := 1;
-
- 3. Exit the editor and save the file.
- 4. Load the file FASTCMD.MS into the Turbo Pascal editor and
- repeat
- steps 2 and 3.
-
-
-
- SCREEN RESTORE UPDATE
-
- The change to the Turbo Editor Toolbox described in this section
- enables Microstar to restore the screen after escaping from the
- copy file command.
-
- The routine to be modified is called:
-
- overlay procedure CopyFile;
-
- This routine is in the file:
-
- MSCMD.MS - MicroStar Source Diskette
-
- The modifications to the code below are indicated by a comment at
- the end of the line:
-
- { Ver. 1.01A - modification }
-
-
- NOTES:
-
-
- 2. Make these modifications on a COPY of the master
- diskette - do NOT modify your master diskettes.
-
-
- SCREEN RESTORE UPDATE
-
- The following are step-by-step instructions for making the
- modification:
-
- 1. Load the file MSCMD.MS into the Turbo Pascal editor.
-
- 2. In the procedure Copyfile, Change from:
- .
- .
- .
-
- If Target = #27 then Target := '';
- if (Target = '') or (Target = Source) then
- exit;
-
- MenuColor := WLowColor; { valid target file, already exists?
- }
- .
- .
- .
-
- Change to:
- .
- .
- .
-
- If Target = #27 then Target := '';
- if (Target = '') or (Target = Source) then
- begin { vs 1.01A addition }
- RestoreWindow(cl,ln,wd,hg); { vs 1.01A addition }
-
- exit;
- end; { vs 1.01A addition }
- MenuColor := WLowColor; { valid target file, already exists?
- }
- .
- .
- .
-
-
- ERASE STRING UPDATE
-
- The change to the Turbo Editor Toolbox described in this section
- enables MicroStar to erase a string correctly when the first
- character is entered for a new string.
-
- The routine to be modified is called:
-
- function GetString;
-
- This routine is in the file:
-
- SCREEN.MS - MicroStar Source Diskette
-
- The modifications to the code below are indicated by a comment at
- the end of the line:
-
- { Ver. 1.01A - modification }
-
-
- NOTES:
-
-
- 2. Make these modifications on a COPY of the master
- diskettes - do NOT modify your master diskettes.
-
- ERASE STRING UPDATE
-
- The following are step-by-step instructions for making the
- modification:
-
- 1. Load the file SCREEN.MS into the Turbo Pascal editor.
- 2. In the function GetStringChange from:
- .
- .
- .
- if (ch in CharFilter) and (byte(St[0]) < Maxlen) then
- begin { check that character is
- legal }
- if newstr then
- .
- .
- .
-
-
- Change to:
- .
- .
- .
- if (ch in CharFilter) then {vs 1.01A
- modification}
- if (byte(St[0]) < Maxlen) or NewStr then {vs 1.01A
- addition}
- begin { check that character is
- legal }
- if newstr then
- .
- .
- .
- ..end
-
-
-
- ACCEPTING PATH NAMES
-
- The change to the Turbo Editor Toolbox described in this section
- enables Microstar to accept path names when specifying a file to
- print.
-
- The routine to be modified is called:
-
- overlay procedure Printinit;
-
- This routine is in the file:
-
- MSCMD.MS - MicroStar Source Diskette
-
- The modifications to the code below are indicated by a comment at
- the end of the line:
-
- { Ver. 1.01A - modification }
-
-
- NOTES:
-
-
- 2. Make these modifications on a COPY of the master
- diskettes - do NOT modify your master diskettes.
-
-
-
- ACCEPTING PATH NAMES
-
- The following are step-by-step instructions for making the
- modification:
-
- 1. Load the file MSCMD.MS into the Turbo Pascal editor.
-
- 2. In the procedure PrintInit, Change from
- .
- .
- .
- SetmemAddress(cl + 2, ln + 1);
- Writestring(prompt);
- CharFilter := ['0'..'9','@'..'Z',':','.','_','$'];
- MenuColor := WNormColor;
- PrintFilename := GetString(cl + 27,ln +
- 1,40,PrintFilename,true);
-
- Change to:
- .
- .
- .
- SetmemAddress(cl + 2, ln + 1);
- Writestring(prompt);
- CharFilter := ['0'..'9','@'..'Z',':','.','_','$','\','_'];
- { vs 1.01A modification }
- MenuColor := WNormColor;
- PrintFilename := GetString(cl + 27,ln +
- 1,40,PrintFileName,true);
-
-
- WORD WRAP UPDATE
-
- The change to the Turbo Editor Toolbox described in this section
- prevents MicroStar from losing the second half of a line when the
- left and right margins are set and word wrap is on.
-
- The routine to be modified is called:
-
- overlay procedure EditCenterLine;
-
- This routine is in the file:
-
- OCMD.MS - MicroStar Source Diskette
-
- There is only one modification to be made to the code below. It
- is listed with a comment at the end of the line:
-
- { Ver. 1.01A - modification }
-
-
- NOTES:
-
-
- 2. Make these modifications on a COPY of the master
- diskettes - do NOT modify your master diskettes.
-
- The following are step-by-step instructions for making the
- modification:
-
- 1. Load the file OCMD.MS into the Turbo Pascal editor.
- 2. In the procedure EditCenterLine, Change from:
-
- .
- .
- .
- Disp := Succ((Llen - Tlen) div 2);
- if not EditSizeline(Curline,Succ(Disp + Tlen)) then
- begin
-
- WORD WRAP UPDATE
- .
- .
- .
- Change to:
- .
- .
- .
- Disp := Succ((Llen - Tlen) div 2);
- if not EditSizeline(Curline,Succ(Disp + Llen)) then
- { Ver. 1.01A - Modification }
- begin
- .
- .
- .
-
- INDENT TEXT UPDATE
-
- The changes to Turbo Editor Toolbox described in this section
- enable the Turbo Editor Toolbox to correctly indent text when the
- left margin has been set and a <Return> is inserted in the middle
- of a line.
-
- The routine to be modified is called:
-
- procedure EditNewLine;
-
- This routine is in two files:
-
- FASTCMD.MS - Microstar Source Diskette
- CMD.ED - .COM files, Toolbox Source Diskette
-
- The modified lines of code are listed in the routine below with a
- comment at the end of the line (Ver. 1.01A - ...). The comment
- indicates when the code is an addition, deletion, or a
- modification.
-
-
- NOTES:
-
-
-
- 2. Make these modifications on a COPY of the master
- diskettes - do NOT modify your master diskettes.
-
- INDENT TEXT
-
- The following are step-by-step instructions for making the
- modifications:
-
- 1. Load the file CMD.ED into the Turbo Pascal editor.
-
- 2. In the procedure EditNewLine, Change from:
- .
- .
- .
- L := Succ (p^.BuffLen - Colno);
- if L < 1 then L := 1;
- if not EditSizeline (Curline, L) then
- begin
- EditErrormsg (35);
- EditRealign;
- exit
- end;
-
- if c >= Colno then
- begin
- Move (p^.Txt^ [Colno], Curline^.Txt^ [l], L);
- Fillchr (p^.Txt^ [Colno], L, ' ')
- end;
- .
- .
- .
- Change to:
- .
- .
- .
- L := Succ (C - Colno); {Ver. 1.01A Modification}
- if L < 1 then L := 1;
- if not EditSizeline(Curline,L + Lmargin) then { Ver.
- 1.01A - modification }
- Begin
- EditErrormsg (35);
- EditRealign;
- exit
- end;
- if c >= Colno then
- INDENT TEXT
-
- begin
- fillchar(Curline^.txt^[1],L + Lmargin,' '); {Ver.
- 1.01A - addition }
- Move(p^.Txt^ [Colno], Curline^.Txt^ [Lmargin], L);
- {Ver. 1.01A - modification }
- Fillchar (p^.Txt^ [Colno], L, ' ')
- end;
-
- .
- .
- .
-
- 3. Load the file FASTCMD.MS into the Turbo Pascal editor.
- 4. Repeat step 2
-
-
- BLOCK COPY HEAP CORRUPTION UPDATE
-
- The changes to the Turbo Editor Toolbox described in this section
- are to prevent the corruption of the heap when doing a block
- copy.
-
- The routine to be modified is called:
-
- procedure EditBlockCopy
-
- This routine is in two files:
-
- KCMD.MS - MicroStar Source Diskette
- KCMD.ED .COM files, Toolbox Source Diskette
-
- The modified lines of code are listed in the routine below with a
- comment at the end of the line (Ver. 1.01A - ...). The comment
- indicates when the code is an addition, deletion, or a
- modification.
-
-
- NOTES:
-
-
- 2. Make these modifications on a COPY of the master
- diskettes - do NOT modify your master diskettes.
-
-
- The following are step-by-step instructions for making the
- modifications:
-
- 1. Load the file KCMD.ED into the Turbo Pascal editor.
- 2. In the procedure EditBlockCopy, Change from:
- .
- .
- .
-
- BLOCK COPY HEAP CORRUPTION UPDATE
-
- with Curwin^ do
- begin
- Match := true;
- for i := 1 to Curline^.Bufflen do
- if Curline^.Txt^ [i] <> ' ' then Match := false;
- if (Curline^.Backlink = nil) and
- (Curline^.Fwdlink = nil) and Match then
-
- begin { copy first record }
- Move (p^.Txt^, Curline^.Txt^, p^.Bufflen);
- Curline^.Fwdlink := p^.Fwdlink;
- Curline^.Flags := p^.Flags;
- u := p^.Fwdlink;
- EditDestxtdes (p);
- if u <> nil then
- u^.Backlink := Curline
- end
-
- .
- .
- .
- Change to:
- .
- .
- .
- with Curwin^ do
- begin
- Match := true;
- for i := 1 to Curline^.Bufflen do
- if Curline^.Txt^ [i] <> ' ' then Match := false;
- if (Curline^.Backlink = nil) and
- Curline^.Fwdlink = nil) and Match then
- begin { copy first record}
- if EditSizeLine(Curline,p^.Bufflen) then { Ver.
- 1.01A - Addition }
- begin
- Move (p^.Txt^, Curline^.Txt^, p^.Bufflen);
- Curline^.Fwdlink := p^.Fwdlink;
- Curline^.Flags := p^.Flags;
- u := p^.Fwdlink:
- EditDestxtdes (p)
- if u <> nil then
- u^.Backlink := Curline;
- end { Ver. 1.01A - Addition
- }
- BLOCK COPY HEAP CORRUPTION UPDATE
-
- else { Ver. 1.01A - Addition }
- begin { Ver. 1.01A - Addition }
- EditErrormsg (35); { Ver. 1.01A - Addition }
- exit; { Ver. 1.01A - Addition }
- end; { Ver. 1.01A - Addition }
- end
- .
- .
- .
-
- 3. Load the file KCMD.MS into the Editor.
- 4. Repeat step 2.
-
-
-
- PREVENTS FILE TRUCATION WHEN PRINTING
-
- The changes to the ETBX in this section prevent MicroStar from
- truncating the end of a file when it is printed.
-
- The modified lines of code are listed in the routines below with
- a comment at the end of the line {Ver. 1.01A - ...}. The comment
- indicates when the code is an addition deletion or modification.
-
- Notes:
-
-
- 2. Make these modifications on a COPY of the master
- diskettes - do NOT modify your master diskettes.
-
- 1. Load the file VARS.MS into the TURBO PASCAL editor.
-
- 2. Add a global variable to the file:
-
- PrintFileSize : real; { Ver. 1.01A Addition }
-
- 3. Save the file VARS.MS and Load the file MSCMD.MS into the
- editor.
-
- 4. At line 40 in the code:
-
- Change from:
- Reset(PrintFile);
-
- Change to:
- Reset(PrintFile,1); { Ver. 1.01A Modification }
-
- 5. At line 45 in the code insert the statement:
-
- PrintFileSize := LongFileSize(PrintFile);
-
-
- 6. Save the file MSCMD.MS and Load the file PRINT.MS into the
- editor.
-
- 7. At line 137 in the code:
-
- PREVENTS END OF FILE TRUCATION WHEN PRINTING
-
- Change from:
- BlockRead(PrintFile, PrintBuffer, 1);
-
- Change to:
- if PrintFileSize >= 128 then {Ver. 1.01A Addition}
- begin
- blockread(PrintFile,PrintBuffer,128); {Ver. 1.01A
- Modification}
- PrintFileSize := PrintFileSize - 128; {Ver. 1.01A
- Addition}
- end {Ver. 1.01A
- Addition}
- else {Ver. 1.01A
- Addition}
- blockread(PrintFile,PrintBuffer,trunc(PrintFileSize));
- {Ver. 1.01A
- Addition}
-
-
-
- SAVING TEXT FORMAT SETTINGS
-
- The changes to the Turbo Editor Toolbox described in this
- handout correct the Save Default Settings command so that
- MicroStar will properly initialize the settings the user saves.
-
- The routine to be modified is called:
-
- function EditCrewindow(Top:integer;Len:integer;Fn:varstring;
- Cr:integer;Cc:integer):Pwindesc;
-
- This routine exists in the file:
-
- USER.MS - MicroStar Source Diskette
-
- The modified lines of code are listed in the routine below
- with a comment at the end of the line: { Ver. 1.01A - ... }. The
- comment indicates when the code is an addition, a deletion, or a
- modification.
-
- NOTES:
-
-
- 2. Make these modifications on a COPY of the master
- diskettes, do NOT modify your master diskettes.
-
- The following are step-by-step instructions for making the
- modifications:
-
- 1. Load the file USER.MS into the Turbo Pascal editor.
-
-
- SAVING DAFAULT TEXT FORMAT SETTINGS
-
- In the function EditCreWindows, Change from:
- .
- .
- Filename := Fn;
- Insertflag := Insert;
- WW := false;
- AI := false;
- Firstlineno := Top;
- .
- .
-
- Change To:
- .
- .
- Filename := Fn;
- Insertflag := InsFlag(InsertDef); { modified ver. 1.01A }
- WW := WordWpDef; { modified ver. 1.01A }
- AI := AutoInDef; { modified ver. 1.01A }
- Firstlineno := Top;
- .
- .
-
-