home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
- PRODUCT : TURBO EDITOR TOOLBOX NUMBER
- : 245
- VERSION : 1.00A
- OS : PC-DOS
- DATE : March 13, 1986 PAGE : 1/2
- TITLE : FILE TRUNCATION UPDATE FROM VERSION 1.00A TO 1.00TB
-
-
-
-
- The changes to the Turbo Editor Toolbox described in this handout
- prevent the truncation of files when they are read from disk. The
- Reset procedure in Turbo Pascal 3.0 provides a second optional
- parameter that defines the size of a block when using un
-
- The routine to be modified is called:
-
- procedure EditReatxtfil (Fn : Varstring);
-
- This routine exists in two files:
-
- KCMD.MS, on the MicroStar Source diskette
- USER.ED, on the .COM Files, Turbo Editor 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.00B - ... }. The
- comment indicates when the code is an addition, a deletion, or a
- modification. Please note that there is only one line to be
- deleted!
-
- NOTES:
-
- 1. These modifications will update Turbo Editor Toolbox to
- version 1.00B. Therefore, you need to update the version
- numbers of the files: MS.PAS, FIRST-ED.PAS, USER.ED and
- KCMD.MS. Also, update the copy-right message for MicroStar
- in MS.PAS.
-
- 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.ED into the Turbo Pascal editor.
- 2. At the bottom of the variable declaration section add a
- variable of type real:
-
- Textsave : Plinedesc;
- Filnam : String80;
- Buffer : array [1..Bufsize] of char;
- x : real; { Ver. 1.00B - Addition }
-
-
-
-
-
-
-
-
-
-
-
-
-
- PRODUCT : TURBO EDITOR TOOLBOX NUMBER
- : 245
- VERSION : 1.00A
- OS : PC-DOS
- DATE : March 13, 1986 PAGE : 2/2
- TITLE : FILE TRUNCATION UPDATE FROM VERSION 1.00A TO 1.00B
-
-
-
-
- 3. Modify the call to Turbo Pascal's procedure Reset:
- Change From:
- Reset (Infile);
- To:
- Reset (Infile,1); { Ver. 1.00B - Modification }
-
- 4. Add a line immediately following the call to Reset:
- .
- .
- begin {Reatxtfil}
- Assign (Infile, Fn);
- Reset (Infile,1); { Ver. 1.00B - Modification }
- x := longfilesize(InFile); { Ver. 1.00B - Addition }
-
- 5. Modify the If-Then statement:
- Change From:
- if Pointer > (Nrecsread * 128) then
- begin
- Blockread (Infile, Buffer, Bufsize div 128, Nrecsread);
- { above is the single line to be deleted }
- To:
- if Pointer > Nrecsread then
- begin { Ver. 1.00B - Modification }
- if x > BufSize then {Need to load another buffer full}
- begin { Ver. 1.00B - addition }
- Blockread (Infile, Buffer, Bufsize, Nrecsread);
- x := x - BufSize; { Ver. 1.00B - addition }
- end
- else { Ver. 1.00B - addition }
- { Ver. 1.00B - addition }
- Blockread (Infile, Buffer, trunc(x), Nrecsread);
-
- 6. Load the file KCMD.MS into the Turbo Pascal editor.
- 7. Repeat steps 2 through 6
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-