home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / VIEWDB.ZIP / VIEWDB.DOC < prev   
Encoding:
Text File  |  1986-05-29  |  8.5 KB  |  164 lines

  1. Documentation for VIEWDB.COM
  2. -------------------------
  3.  
  4. Version 1.01 for PC-DOS Turbo Pascal Version 3
  5.   by Scott Bussinger -- May 1986
  6.      Professional Practice Systems, Inc.
  7.      110 S. 131st Street
  8.      Tacoma, WA  98444
  9.      (206)531-8944
  10.      Compuserve [72247,2671]
  11.  
  12. Revision History
  13. ----------------
  14.   Version 1.00  --  February 1986  --  Initial release into the public domain
  15.           1.01  --  May 1986       --  Removed limitations on maximum data
  16.                                          record size.
  17.  
  18. What it does
  19. ------------
  20.   VIEWDB.COM is a resident program which allows a user to browse through a
  21. data file created using Borland International's Turbo Database Toolbox.  The
  22. program allows the display of record contents as bytes in hex, as characters,
  23. or using an information file describing the record layout to see the contents
  24. of each field interpreted as your programs see them.  Since this is a resident
  25. program based on STAYRES.340 by Lane Ferris, the program is executed once and
  26. stays in memory.  From then on you can call up the browser while executing any
  27. other program without first exiting.  This allows a programmer to check the
  28. structure of a data file while testing out an application.
  29.   The program is designed for use with an IBM compatible computer with a
  30. color monitor.  It might work with a monochrome monitor, but I don't know what
  31. effect the color assignments are going to have.
  32.  
  33. How to use it
  34. -------------
  35.   The first step to using VIEWDB.COM is to execute the program from any DOS
  36. prompt.  It will display a title message and remind you that the activation
  37. key is Alt <F9>.  At this point, to activate the browser from either a DOS
  38. prompt or from within another program, hit Alt <F9> and the browser will
  39. display a record of the current datafile in the upper right corner of the
  40. display and a help message in the upper left.  At this point you have
  41. ten commands available to you:
  42.     <F1> Select File - This command allows you to enter the name of the
  43.            Turbo Toolbox datafile to be examined.  You may enter a full
  44.            pathname and the default extension for the file is ".DB".  If
  45.            the program can't find an information file for the selected
  46.            datafile in the same directory, it will prompt for the record
  47.            length in bytes for the data file.  The program will then
  48.            display record 0 of the new file.  If an information file
  49.            was available, then the display mode will be the interpreted
  50.            mode and the data display will be blank.  If no information file
  51.            was found, then the display will be in hex data mode.  At the top
  52.            of the display, the current values returned by the toolbox
  53.            functions FileLen and UsedRecs are displayed along with the number
  54.            of the first deleted record in the file.
  55.     <F3> Set Record Number - This command allows you to enter the number of
  56.            the record in the current file to be displayed.  The number is
  57.            in in base 10 (not hex) and must exist in the current data file.
  58.     <F5> Change Display Mode - This command allows you to switch between the
  59.            three available display modes while viewing a data record.  The
  60.            available modes are:
  61.              Hex Data - The record is displayed as a series of data bytes in
  62.                hexadecimal format.
  63.              Ascii Data - The reocrd is displayed as a series of display
  64.                characters.  Control characters are displayed as periods.
  65.              Interpreted Data - This mode is only available if you have
  66.                previously prepared an information file as described below
  67.                and displays each of the fields in the record in a readable
  68.                format.  If the current record number is 0, then the display
  69.                is empty since record 0 does not contain user data.
  70.     <F9> Exit - Removes the browser from the screen and returns to the
  71.            application program where you left off.  The browser can be
  72.            called up again at any time.
  73.     <Home> Goto First Record - Sets the current record number to 0.
  74.     <End> Goto Last Record - Sets the current record number to the last record
  75.             in the file.
  76.     <PgUp> Next Record - Advances to the next record number.  Will not
  77.              display past the last record in the file.
  78.     <PgDn> PreviousRecord - Goes back one record in the file.  Will not
  79.              display past the record 0.
  80.     <DnArrow> Next Piece of Display - If the record is large enough to not
  81.                 be fully displayed on the screen at one time, this brings up
  82.                 the next part of the record.
  83.     <UpArrow> Previous Piece of Display - If the record is large enough to not
  84.                 be fully displayed on the screen at one time, this brings up
  85.                 the previous part of the record.
  86.  
  87. Information Files
  88. -----------------
  89.   These are standard text files produced using the Turbo editor, Sidekick, or
  90. any word processor capable of generating non-document ascii text files.  The
  91. contents describe the size of layout of the fields within a data file record.
  92. The file is kept in the same directory with the data file and shares the same
  93. primary name with an extension of ".INF".  The first line is simply the number
  94. of bytes in a data record (the record length).  The remaining lines each have
  95. the following format:
  96.  
  97. Field Type - A single character located in column 1 describing the type of
  98.                data in this field.  The current list of allowable types are:
  99.                     'R' - A real number printed in a 10 character field width
  100.                     'A' - A real number representing an integer number of
  101.                             pennies and displayed as an amount with 2 decimal
  102.                             places.
  103.                     'I' - An integer number.
  104.                     'W' - A 16 bit word of data displayed as an unsigned
  105.                             decimal number.
  106.                     'B' - A single byte of data displayed as a number from
  107.                             0 to 255.
  108.                     'D' - An integer number displayed as a date.  The date
  109.                             is an encoded julian day number as used in the
  110.                             file JDATE.PAS available separately.
  111.                     'C' - A single character.
  112.                     all others - A single byte displayed in hex format.
  113. Offset - The number of bytes into the data record where this field starts.
  114.            The first field thus has an offset of 0.
  115. Repeat Count - The number of items in the array for this field.  A single item
  116.                  has a repeat count of 1.  An array[0..3] has a repeat count of
  117.                  4.  All of the elements of the array are displayed on one
  118.                  line.
  119. Field Name - A title for the field.  Limited to 20 characters.
  120.  
  121.   The first field starts in column 1 and is followed by at least 1 space.  All
  122. of the remaining fields are separated by 1 or more spaces.  The program allows
  123. at most 50 lines of field descriptors.  Now for an example of a pascal record
  124. definition and its corresponding information file.  Assume the following type
  125. definition is used for a data file called ENTRIES.DB:
  126.  
  127. type FeeEntry = record
  128.        DeletedFlag: integer;
  129.        Title: array[1..24] of char;
  130.        SalesTax: real;
  131.        SaDuration: integer;
  132.        SaDeductible: integer;
  133.        Ask: set of 0..15;
  134.        BaseFee: integer;
  135.        Modifier: array[0..3] of integer
  136.        end;
  137.  
  138.   The following lines would be used in a file called ENTRIES.INF:
  139.  
  140. 48
  141. w  0  1 Deleted
  142. c  2 24 Title
  143. r 26  1 Sales Tax
  144. i 32  1 SA Duration
  145. i 34  1 SA Deductible Ptr
  146. w 36  1 Ask Flags
  147. i 38  1 Base Fee Ptr
  148. i 40  4 Modifiers
  149.  
  150.   The first 48 is the total record size.  The first line displays the deleted
  151. record pointer as a 16 bit unsigned number.  Then the 24 character title and
  152. the rest of the record.  There is no need to follow the same sequence in the
  153. information file as in the actual field definition.  You may also omit or
  154. duplicate fields.
  155.  
  156. Future Directions
  157. -----------------
  158.   This is the first version of VIEWDB and leaves much to be done.  First of
  159. all would be more data types for information files.  Also elimination of
  160. some restrictions like the maximum number of field descriptors in the
  161. information files.  If you have any problems or suggestions with this program
  162. please leave a message for me on Compuserve and I'll see what can be
  163. done to improve the program.
  164.