home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
turbopas
/
conv_p18.arc
/
CONV_P.DOC
< prev
next >
Wrap
Text File
|
1989-11-21
|
6KB
|
118 lines
The file included, UPCONV.EXE, is a program published in 'Turbo Pascal
Library' published by Sybex books. It is a modification of the program
UPCASE.PAS. This program will convert all the reserved words in a Turbo
Pascal program to uppercase, leaving strings and comments unchanged. This
version was modified (so the include file was not necessary) by Derron Simon
(GEnie Mail: D.SIMON). If you find it interesting, I would recommend you
purchase 'Turbo Pascal Library'. It is full of useful routines. Have fun!!
v1.8, Toad Hall, 20 Nov 89
- Renamed to CONV_P (to accompany the CONV_A assembly language
conversion utility).
- Now permits command-line entry of desired reserved word data files
(via a new '/Idatafile.typ' command line entry).
- Including a file of reserved words from TechnoJocks TTT5 package.
- Using STRINGS.TPU. (See STRINGS.DOC for credits.)
- Slightly tweaked the POS() replacement function POSBM (now POSBM2.ASM,
POSBM2.OBJ).
- Completely rewrote TOK_STR (now TOKSTR18.PAS) to produce one output
reserved word string data file (CONV_P.DAT) from one (or more)
target reserved word text files. (Now we can use libraries of
reserved words, right?)
v1.6, Toad Hall, 20 Oct 89
- Moved the reserved word strings to an external file (UPCONV.DAT),
created by the TOK_STR utility.
- Now uses linked lists of string pointers to dynamic reserved
word strings (rather than the previous "hard-coded" typed constant
array of reserved word strings).
- Add a couple more missing reserved words (ParamCnt, ParamStr),
changed 'Assign' to "ASSIGN".
- Executable is now smaller, loads faster, runs faster.
v1.5, Toad Hall, 13 Oct 89
- Adding some missing reserved words (LongInt, Word)
- Added a modicum of file write error-trapping.
v1.4, Toad Hall, 15 Jun 89
- Added some missing reserved words (FillChar, FOR, FUNCTION).
- Adding faster replacement for the POS() function (POSBM).
- Made Args array dynamic (e.g., via pointers)
- Buffering string reads, writes into two dynamic buffers to reduce
disk thrashing, slightly speed up program (maybe 10%).
(Not doing any memory testing right now .. hope your system
has enough memory!)
- Writing a terminating ^Z to our output file
(just to be neat, keep same file size, etc.).
- Still no file read/write error-trapping.
v1.3, Toad Hall, 14 Apr 89
- Rewrote for Turbo Pascal v5.0
- Added a bunch of Turbo Pascal v4.0/v5.0 reserved words.
- Tightened code a lot.
- Adding multiple or wildcard capability.
You can now:
UPCONV FOO1 FOO2 converts FOO1.PAS and FOO2.PAS
to FOO1.FMT and FOO2.FMT respectively
or UPCONV *.PAS converts all .PAS files to .FMT
or UPCONV FOO* converts all FOO*.PAS files to FOO*.FMT
or UPCONV *.* converts ALL files to .FMT (careful!)
Target files can be anywhere (e.g., you can include a path),
but the .FMT output will be to current drive:\directory.
UPCONV will NOT overwrite existing .FMT files (unless you change an IFDEF
in the source code and recompile).
- Added an "/L" (or "-l") switch to convert ordinary Pascal (e.g.,
non-Borland) reserved words to lower case.
The "/U" (or ("-u") switch still converts ALL reserved words
to uppercase.
- Run UPCONV13 with no parameters for help.
- Adding separate utility (TOK_STR.PAS and TOKEN.INC)
to produce nicely formatted strings of reserved words
(so we can easily update this sucker!).
- Distributing separately from earlier versions
(e.g., no more Turbo v3.0 or CP/M versions in this archive).
v1.2, 12 Oct 88
- Fixed bugs that (1) would (1) just quit processing and write out as-is,
and (2) would not leave quoted strings alone.
(Dumb .. sorry, guys, just didn't test enough.)
v1.1, 23 Sep 88
- Table of reserved words now includes Turbo Pascal MS-DOS v3.0.
- Tweaked for speed, tightness.
- Now provides reserve word uppercasing (standard Pascal words)
and "Borland format" for Turbo Pascal words.
- No more prompted filename input. Gives help if incorrect command line.
Usage: UPCONV [-[uh?]] file1[.PAS] file2[.FMT] [-[uh?]]
where:
input file file1 has default .PAS type
output file file2 has default .FMT type (program will use input
file name if no output name provided)
Switches '-' or '/' are accepted before or after file names:
U - force uppercasing of ALL Pascal words (no Borland format).
?, h - display help, quit
Note: I tweaked this program to replace PFORMAT, another Pascal reformatting
program. It has a few more functions than UPCONV does, but its basic
algorithm for finding and replacing reserved words is a slug (despite my
most fervent tweaking!).
One ESSENTIAL Note:
PFORMAT has a funny way of handling comments (the {} and (* *) tokens).
It will NOT reformat any code or text within {} tokens.
It WILL reformat any code (or text!) within (* *) tokens.
So .. if you're in the habit of commenting out a bunch of text
with the (* *) tokens .. you're gonna get some strange text!
Get in the habit of (1) Excluding text with {} tokens,
and (2) Temporarily commenting out code with (* *) tokens.
This is NOT a bug, but a feature! You can temporarily comment out code,
yet still have it properly reformatted.
David Kirschbaum
Toad Hall
kirsch@arsocomvax.socom.mil