home *** CD-ROM | disk | FTP | other *** search
-
- DBeautifier - A dBASE/Clipper Utility Rev 2.0 Apr 24, 1988 Page 1
-
-
-
-
-
- Table Of Contents
- -----------------
-
-
-
-
- TOPIC PAGE
- ----- ----
-
- Features and Overview ............................... 2
-
- Using DB ............................................ 3
-
- Options
- C - Comments on Column One ...................... 4
- d - Display ..................................... 4
- h - Header ...................................... 4
- l - List File ................................... 4
- o - Output File ................................. 5
- s - Spaces ...................................... 5
- t - Tab ......................................... 5
- u - Untab ....................................... 5
- U - Unbeautify .................................. 5
- v - Verbose ..................................... 6
- w - No Error On Screen .......................... 6
- W - No Error In File ............................ 6
- x - Shift Expression Continuation ............... 6
-
- Using RAMdisk ....................................... 6
-
- Error Messages ...................................... 7
-
- DB's History ........................................ 8
-
- General Information ................................. 9
-
- Acknowledgment ...................................... 9
-
- Software License .................................... 10
-
- DBeautifier - A dBASE/Clipper Utility Rev 2.0 Apr 24, 1988 Page 2
-
-
-
- FEATURES
-
-
- o General syntax checking
-
- o Indentation with tab or spaces
-
- o Creates .LST file
-
- o Generates .BAK file
-
- o Replaces dBASE III editor's wrap around character with ';'
-
- o On screen status displayed through Verbose mode
-
- o Option avialable to condense source file
-
- o RAMdisk support
-
-
-
- OVERVIEW
-
-
- The development of DBeautifier was inspired by CBeautifier, a C
- program beautifier, in the UNIX environment. DB is also similar to
- "Pretty", for those who program in PASCAL. DB started out as a
- simple tool to help me understand the structure of my colleague's
- codes using stdin and stdout.
-
- DBeautifier organizes the structures of any dBASE/Clipper program
- files, controlling the proper indentations of IF's, DO WHILE's, etc.
-
- Syntax Error Messages are imbedded in the output file and displayed
- on the CRT. Options are available to disable Error Messages.
-
- DBeautifier works on .PRG files only, if extensions are not given DB
- assumes .PRG. DB renames the original input file to .BAK and
- generates a new .PRG. Options like -d, -l and -o operates different
- from those described above.
-
- The dBASE editor sometimes generate a wrap around character that can
- not be seen. This wrap around character causes a Clipper compile
- error. DB will replace this character with a semicolon. If the line
- is a comment the wrap around character is replaced with a space.
-
- DB now supports the 4 character syntax.
-
- DBeautifier - A dBASE/Clipper Utility Rev 2.0 Apr 24, 1988 Page 3
-
-
-
- USING DB
-
-
- Usage: DB [Options] files...
-
-
- Options can be located anywhere on the command line, and is Case
- sensitive
-
- DB -W file1 -vt
-
- Command line switches must all take the form:
-
- -<character>[<number>|<string>]
-
- That is, all arguments start with either a dash (-) or a slash (/).
- Each switch is identified with a single letter that immediately
- follows the switchchar (no intervening spaces). The letter may be
- followed by an optional number or string, again with no spaces
- between the identifying character and the corresponding number or
- string. Switches may be combined, if the argument types allow this
- combination. For example, the command line:
-
- DB -l -s20 -C file1 file2
-
- can also be given as:
-
- DB -ls20C file1 file2
-
- However, if a string is expected after the identifying character
- (-o), then the rest of the argument is assumed to be part of the
- string. You have to be careful when combining string type command
- line switches with other types.
-
- There are times when certain options are always desired. Instead of
- typing these options every time you are DBing, set the environment
- variable DBFLAGS to contain your default options.
-
- Environment variables are variables defined using the MS-DOS SET
- command. The environment variables could be set as follows:
-
- C:\>set dbflags=-Cs5 -x3
-
- The MS-DOS set commands should be added to the batch file
- AUTOEXEC.BAT so they will be set at MS-DOS start time. See also the
- RAMdisk section.
-
- After DBFLAGS have been set the results of the command line will be
- appended with the environment variable.
-
- ex. C:\>DB -l *.prg
-
- will be expanded to
-
- DB -l *.prg -Cs5 -x3
-
- DBeautifier - A dBASE/Clipper Utility Rev 2.0 Apr 24, 1988 Page 4
-
-
-
- OPTIONS
-
-
- -C COMMENT ON COLUMN ONE - Positions all comments on Column
- one. This option is for those who like their comments on
- the first column.
-
- ex. 00001: Do while .not. eof()
- 00002:
- 00003: * Use trade activity and scan for match
- 00004: select trades
- 00005: * make sure trade file starts on TOF
- 00006: go top
-
- NOTE: The only option that effects the commented line is
- -u (untab).
-
-
- -d DISPLAY (STDOUT) - Send output to stdout. This option is
- used for piping and redirection purposes. The .PRG(s) are
- not modified at all. Options v and W are disabled. Option
- w is enabled.
-
- ex. DB -dv file1 file2 | more
-
- Even thought verbose is requested the option is disabled.
- File1 and file2 will be beautified without modifying the
- original program (file1.prg, file2.prg). Output is piped to
- more.
-
-
- -h HEADER STAMP - Enable header stamp. Previous header stamp
- will be replaced by current header. The header contains the
- current date and time. ** PRIOR TO REVISION 1.6 THIS OPTION
- DISABLED THE HEADER STAMP.
-
- ex. 00001: **
- 00002: *
- 00003: * DBed on Sun. Apr 03, 1988 17:30:03
- 00004: *
- 00005: **
-
-
- -l LIST FILE - Generate a listing file. A .LST file with line
- numbers are generated. If the option -d is used output is
- send to display, and .LST is not generated. If -o<str> is
- used output is send to filename <str>.
-
- ex. DB -lolisting.lst file1
-
- Generate a list file and send output to filename
- "listing.lst".
-
- DBeautifier - A dBASE/Clipper Utility Rev 2.0 Apr 24, 1988 Page 5
-
-
-
- -o<str> OUTPUT FILE - Redirects output to filename <str>. Original
- program files are not modified. The output of DB is send to
- the file specified.
-
- NOTE: When DBing multi-files, the -o option is valid for
- the last file DBed.
-
- ex. DB -ofile.out file1 file2
-
- File.out contains file2's output. File1's output is lost.
-
-
- -s<num> SPACES - Use <num> spaces as leading characters for
- indentation. When used with -t, -t overrides -s. Use of
- -s0 will eliminate any leading spaces, or tabs. -s0 does
- not remove newlines. See also -U.
-
- This option is the default with <num> equal 4.
-
-
- -t TAB - Use tab character instead of spaces as leading
- characters. A tab per indentation is used.
-
-
- -u<num> UNTAB - Replace tab characters BETWEEN words with <num>
- spaces. This is not a substitute for -s<num> since -s is
- for leading character. This option is for laser printers
- that do not print out tab characters.
-
- NOTE: This option is not a literal substitution but is
- dependent on the position of the tab on a given
- line.
-
-
- -U UNBEAUTIFY - condense code to save spaces by striping all
- leading White spaces (INCLUDING NEWLINES). This option will
- enable -s0.
-
- ex. 00001: if this = .t.
- 00002:
- 00003: do that
- 00004:
- 00005: endif
-
- becomes
-
- 00001: if this = .t.
- 00002: do that
- 00003: endif
-
- DBeautifier - A dBASE/Clipper Utility Rev 2.0 Apr 24, 1988 Page 6
-
-
-
- -v VERBOSE - Display status of DB while file is being DBed.
- The structures will be displayed with the proper
- indentations. Indentations of verbose mode uses 4 spaces
- that are not dependent of -s or -t.
-
-
- -w NO ERROR ON SCREEN - Suppresses Syntax Error messages on
- screen. Use -W for suppression of syntax error messages in
- program code file. -w disables -W option. The -d option
- enables -w option so output on screen is not distorted by
- syntax error messages on screen.
-
-
- -W NO ERROR IN FILE - Suppresses Syntax Error messages in
- output file. This option is disabled if -d or -w is used.
-
-
- -x<num> EXPRESSION CONTINUATION - Shift expression continuations
- represented by ';' with <num> spaces.
-
- ex. 00123: replace code with a->code, sequence with ;
- 00124: a->seq no, customer with a->id code, ;
- 00125: interest with a->principle*a->rate
- 00126: do programx
-
- NOTE: Wrap around characters are replaced with ';' and -x
- is applied. If the wrap around character is within
- a comment, a space will replace the wrap around
- character.
-
- This option is a default with <num> equaling 2 spaces.
-
-
-
- RAMdisk
-
-
- DBeautifier sometimes creates a temporary file. The default drive
- for the temporary files are the current drive and directory. DB
- performance can be increased by utilizing a RAMdisk. DBeautifier
- searches the environment for the variable TMP. Set TMP=path, where
- path is the location of temporary file to be created. See also USING
- DB.
-
- ex. SET TMP=d:\
-
- Drive D is used as the temporary drive.
-
- ex. SET TMP=d:\tmpdir
-
- Drive D, in directory tmpdir is used for the creation of the
- temporary file.
-
- Prior to revision 2.0 the environment variable DBTMP was used. Now
- the usage of TMP is supported. DBTMP is no longer supported.
-
- DBeautifier - A dBASE/Clipper Utility Rev 2.0 Apr 24, 1988 Page 7
-
-
-
- ERROR MESSAGES
-
-
- There are two types of Error messages, Syntax and I/O. The syntax
- error is caused by incorrect coding. The I/O errors could be caused
- by either Hidden files, Insufficient disk space, or Read-only files.
-
-
- The following messages relate to Syntax Errors
-
- Endif without If
- Preceding IF <condition> not found
- Else without If
- Preceding IF <condition> not found
- Elseif without If
- Preceding IF <condition> not found
- Enddo without Do While
- Preceding DO WHILE not found
- Case without Do Case
- Preceding DO CASE not found
- Otherwise without Do Case
- Preceding DO CASE not found
- Endcase without Do Case
- Preceding DO CASE not found
- Next without For
- NEXT must have corresponding FOR
- Procedure encounter while unmatched scoop exist
- An open structure exist when PROCEDURE encountered
- Function encounter while unmatched scoop exist
- An open structure exist when FUNCTION encountered
- Illegal use of parameters
- Preceding FUNCTION or PROCEDURE not found
-
-
- The following messages relate to I/O Errors
-
- Error opening output file
- Output file specified by -o option may be read-only file
- Error opening input file
- Input file may not exist
- Error opening temporary file
- Disk may be full
- Error opening list file
- File with .LST extension may exist with read-only mode
- Error removing Backup file
- Old backup file may be a read-only file
- Disk write error
- Disk may be full
- Incorrect extension used
- DB expects .PRG extension
-
- DBeautifier - A dBASE/Clipper Utility Rev 2.0 Apr 24, 1988 Page 8
-
-
-
- HISTORY
-
-
- Revision 1.5:
-
- o Supports keywords used as memory variables.
- o Error messages displayed on screen now contains line number
- of syntax error.
- o Handles dBASE Editor's Wrap around character.
- o New option -x (Shift Continue Expressions).
-
- Revision 1.6:
-
- o Support of Clipper Summer '87 Extended Syntax.
- o Supports the verbose mode option.
- o New option -W (Suppress Error Messages in output file).
- o TEXT..ENDTEXT is now supported.
- o -h option now ENABLES not disables header stamp.
-
- Revision 1.6.4:
-
- o RAMdisk supported.
- o Options may be entered with either '-' or '/'.
- o DB is now an EXE not a COM.
- o Includes Disk Full Checking.
- o When I/O Error accrues DB will display error message and
- CONTINUE with the next file.
-
- Revision 2.0:
-
- o Supports the four characters syntax.
- o Handles Ctl C/CTL BREAK.
- o Use environment variable TMP instead of DBTMP.
- o Use environment variable DBFLAGS for default options.
- o New option -C (Comments on Column one).
- o Corrected the handling of semicolon within Comments.
- o Syntax Error Messages in output file are now "***" not
- "****"
-
- DBeautifier - A dBASE/Clipper Utility Rev 2.0 Apr 24, 1988 Page 9
-
-
-
- GENERAL INFORMATION
-
-
- DB will run on any IBM PC/XT/AT/Portable/Convertible or any True
- MS-DOS compatible computer running PC/MS-DOS 2.0 or higher with a
- minimum of 128K free RAM.
-
- IBM is a registered trademark of the International Business Machine
- Corporation.
- MS-DOS is a registered trademark of Microsoft Inc.
- dBASE III is a registered trademark of Ashton-Tate
- Clipper is a registered trademark of Nantucket Corporation
-
- Benchmarks are available upon request. Please note that DB is a Disk
- intensive utility. High performance Hard drives have better results
- on the benchmark. Floppy is the Slowest you will get. Even though a
- RAMdisk is used for temporary files, these files have to be written
- back to original file location. High performance Machines have
- better results.
-
- If you have any questions, comments or suggestions about DB send them
- to Thomas Li at:
-
- NYCENET BBS, Fred Goldberg SYSOP
- Buzz Robbins Alt. SYSOP
- New York, New York
- At main menu type "j dbase"
- 212-769-0550
- 300/1200 baud, 24 hours a day
-
- or
-
- H.Q. BBS, Bob Kurtz & Richard Healy SYSOP
- At main menu type "j db"
- 212-790-9290
- 300/1200/2400 baud, 6pm - 8am Eastern 24hrs Sat & Sun
-
- or
-
- ** For Technical Questions Related With Computer Languages Only **
- New York BBS Service, Richard Green SYSOP
- New York, New York
- 212-980-0770
- 300/1200 baud, 24 hours a day
-
-
-
- ACKNOWLEDGMENT
-
-
- Special thanks to Marc Schnapp, president of New York Metro Clipper
- User's Group, for suggesting the use of TMP and reminded me of the 4
- character syntax support. Thanks to Jose Vega for his help in the
- Benchmarks of DB. Most importantly, Thanks to Lord Jesus for His
- help, support, encouragement, and faithful promises.
-
- DBeautifier - A dBASE/Clipper Utility Rev 2.0 Apr 24, 1988 Page 10
-
-
-
- LICENSE
-
-
- DB - Copyright (C) 1988 by Thomas Y. Li. All Rights Reserved.
-
- Potions Copyright by Allen I. Holub, used with permission.
-
-
- You are free to use, copy and distribute DBeautifier for
- noncommercial use IF:
-
- IT IS NOT MODIFIED IN ANYWAY.
-
- NO FEE IS CHARGED FOR USE, COPYING OR DISTRIBUTION.
-
- Clubs and user groups may charge a nominal fee (less than $10) for
- expenses and handling while distributing DB. Remember that I depend
- on you and your colleague's support.
-
- Everyone is encouraged to distribute DBeautifier to your friends,
- associates, or to a Bulletin Board System (BBS), please distribute
- the file DB20.EXE or DB20.ARC rather than the individual files for
- README.DB, DB.EXE and DB.DOC. Note that DB20.EXE contains an
- additional file DB20.ARC.
-
- This program is provided AS IS without any warranty, expressed or
- implied, including but not limited to fitness for a particular
- purpose.
-
- Remember that DBeautifier is a Shareware. I depend on your
- contributions for support. If this product has helped you in anyway,
- please send contributions to:
-
- Thomas Y. Li
- 79 Chrystie St. #16
- New York, NY 10002-5014
-
- Feel free to contact me through either NYCENET BBS or New York BBS.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-