home *** CD-ROM | disk | FTP | other *** search
- Documentation for VIEWDB.COM
- -------------------------
-
- Version 1.01 for PC-DOS Turbo Pascal Version 3
- by Scott Bussinger -- May 1986
- Professional Practice Systems, Inc.
- 110 S. 131st Street
- Tacoma, WA 98444
- (206)531-8944
- Compuserve [72247,2671]
-
- Revision History
- ----------------
- Version 1.00 -- February 1986 -- Initial release into the public domain
- 1.01 -- May 1986 -- Removed limitations on maximum data
- record size.
-
- What it does
- ------------
- VIEWDB.COM is a resident program which allows a user to browse through a
- data file created using Borland International's Turbo Database Toolbox. The
- program allows the display of record contents as bytes in hex, as characters,
- or using an information file describing the record layout to see the contents
- of each field interpreted as your programs see them. Since this is a resident
- program based on STAYRES.340 by Lane Ferris, the program is executed once and
- stays in memory. From then on you can call up the browser while executing any
- other program without first exiting. This allows a programmer to check the
- structure of a data file while testing out an application.
- The program is designed for use with an IBM compatible computer with a
- color monitor. It might work with a monochrome monitor, but I don't know what
- effect the color assignments are going to have.
-
- How to use it
- -------------
- The first step to using VIEWDB.COM is to execute the program from any DOS
- prompt. It will display a title message and remind you that the activation
- key is Alt <F9>. At this point, to activate the browser from either a DOS
- prompt or from within another program, hit Alt <F9> and the browser will
- display a record of the current datafile in the upper right corner of the
- display and a help message in the upper left. At this point you have
- ten commands available to you:
- <F1> Select File - This command allows you to enter the name of the
- Turbo Toolbox datafile to be examined. You may enter a full
- pathname and the default extension for the file is ".DB". If
- the program can't find an information file for the selected
- datafile in the same directory, it will prompt for the record
- length in bytes for the data file. The program will then
- display record 0 of the new file. If an information file
- was available, then the display mode will be the interpreted
- mode and the data display will be blank. If no information file
- was found, then the display will be in hex data mode. At the top
- of the display, the current values returned by the toolbox
- functions FileLen and UsedRecs are displayed along with the number
- of the first deleted record in the file.
- <F3> Set Record Number - This command allows you to enter the number of
- the record in the current file to be displayed. The number is
- in in base 10 (not hex) and must exist in the current data file.
- <F5> Change Display Mode - This command allows you to switch between the
- three available display modes while viewing a data record. The
- available modes are:
- Hex Data - The record is displayed as a series of data bytes in
- hexadecimal format.
- Ascii Data - The reocrd is displayed as a series of display
- characters. Control characters are displayed as periods.
- Interpreted Data - This mode is only available if you have
- previously prepared an information file as described below
- and displays each of the fields in the record in a readable
- format. If the current record number is 0, then the display
- is empty since record 0 does not contain user data.
- <F9> Exit - Removes the browser from the screen and returns to the
- application program where you left off. The browser can be
- called up again at any time.
- <Home> Goto First Record - Sets the current record number to 0.
- <End> Goto Last Record - Sets the current record number to the last record
- in the file.
- <PgUp> Next Record - Advances to the next record number. Will not
- display past the last record in the file.
- <PgDn> PreviousRecord - Goes back one record in the file. Will not
- display past the record 0.
- <DnArrow> Next Piece of Display - If the record is large enough to not
- be fully displayed on the screen at one time, this brings up
- the next part of the record.
- <UpArrow> Previous Piece of Display - If the record is large enough to not
- be fully displayed on the screen at one time, this brings up
- the previous part of the record.
-
- Information Files
- -----------------
- These are standard text files produced using the Turbo editor, Sidekick, or
- any word processor capable of generating non-document ascii text files. The
- contents describe the size of layout of the fields within a data file record.
- The file is kept in the same directory with the data file and shares the same
- primary name with an extension of ".INF". The first line is simply the number
- of bytes in a data record (the record length). The remaining lines each have
- the following format:
-
- Field Type - A single character located in column 1 describing the type of
- data in this field. The current list of allowable types are:
- 'R' - A real number printed in a 10 character field width
- 'A' - A real number representing an integer number of
- pennies and displayed as an amount with 2 decimal
- places.
- 'I' - An integer number.
- 'W' - A 16 bit word of data displayed as an unsigned
- decimal number.
- 'B' - A single byte of data displayed as a number from
- 0 to 255.
- 'D' - An integer number displayed as a date. The date
- is an encoded julian day number as used in the
- file JDATE.PAS available separately.
- 'C' - A single character.
- all others - A single byte displayed in hex format.
- Offset - The number of bytes into the data record where this field starts.
- The first field thus has an offset of 0.
- Repeat Count - The number of items in the array for this field. A single item
- has a repeat count of 1. An array[0..3] has a repeat count of
- 4. All of the elements of the array are displayed on one
- line.
- Field Name - A title for the field. Limited to 20 characters.
-
- The first field starts in column 1 and is followed by at least 1 space. All
- of the remaining fields are separated by 1 or more spaces. The program allows
- at most 50 lines of field descriptors. Now for an example of a pascal record
- definition and its corresponding information file. Assume the following type
- definition is used for a data file called ENTRIES.DB:
-
- type FeeEntry = record
- DeletedFlag: integer;
- Title: array[1..24] of char;
- SalesTax: real;
- SaDuration: integer;
- SaDeductible: integer;
- Ask: set of 0..15;
- BaseFee: integer;
- Modifier: array[0..3] of integer
- end;
-
- The following lines would be used in a file called ENTRIES.INF:
-
- 48
- w 0 1 Deleted
- c 2 24 Title
- r 26 1 Sales Tax
- i 32 1 SA Duration
- i 34 1 SA Deductible Ptr
- w 36 1 Ask Flags
- i 38 1 Base Fee Ptr
- i 40 4 Modifiers
-
- The first 48 is the total record size. The first line displays the deleted
- record pointer as a 16 bit unsigned number. Then the 24 character title and
- the rest of the record. There is no need to follow the same sequence in the
- information file as in the actual field definition. You may also omit or
- duplicate fields.
-
- Future Directions
- -----------------
- This is the first version of VIEWDB and leaves much to be done. First of
- all would be more data types for information files. Also elimination of
- some restrictions like the maximum number of field descriptors in the
- information files. If you have any problems or suggestions with this program
- please leave a message for me on Compuserve and I'll see what can be
- done to improve the program.