home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / edb21.zip / EDB.DOC < prev    next >
Text File  |  1991-04-03  |  14KB  |  263 lines

  1.                                       EDB 
  2.                                 Ed's Data Base 
  3.  
  4.                             Copyright 1991 Ed Hand 
  5.  
  6.  
  7.          This file is in two sections.  The first deals with the use of
  8.     EDB.EXE.  The second section goes into detail on the format of the 
  9.     form file and how to write your own form files.
  10.  
  11.  
  12.     Section One: How to get around in EDB
  13.  
  14.  
  15.          EDB is a database whose format is defined by an ascii form file.  
  16.     The form file has an extension of ".frm".  The fields of a form can 
  17.     contain simple static information for display or accept any format of
  18.     input. 
  19.  
  20.          Execution of EDB is simple.  The name of the form file is given 
  21.     on the command line with no other arguments.  For example: 
  22.  
  23.              EDB PHOTO 
  24.  
  25.          This will start EDB and try to open a file named "PHOTO.FRM".  
  26.     If the file cannot be found in the current directory EDB will issue 
  27.     an error and halt execution.  If the file is successfully opened then 
  28.     EDB will read the form description, draw the screen and then allow 
  29.     you to start processing.  To run EDB the only files needed are the 
  30.     executable EDB.EXE and a form file. 
  31.  
  32.          Once EDB has been started you will see a working screen.  You 
  33.     will stay at this screen for the entire program.  All commands are 
  34.     available from an options menu at the top of the screen.  There are 
  35.     several ways to select a command.  You may use the arrow keys to move 
  36.     the cursor around to the different commands.  Or for most commands 
  37.     you may simply enter the first letter of the command and EDB will 
  38.     move the cursor to that command.  The only exception to this is the 
  39.     compress command.  To move to the compress command enter the letter 
  40.     "O", the second letter of the word.  Once the command is highlighted 
  41.     press enter to select the command.  Users of emacs can also use 
  42.     standard emacs cursor commands to move the cursor:
  43.  
  44.              Cntrl-P and Cntrl-B move to the previous command.
  45.  
  46.              Cntrl-F and Cntrl-N move to the next command.
  47.  
  48.     Note that the emacs commands only work on the options menu.  If you 
  49.     are editing a field and enter a control character it will be entered 
  50.     as part of the data.  More on that later.  From the options menu you 
  51.     may also use Cntrl-R or Cntrl-L to redraw the screen.  This is useful 
  52.     if an ill behaved TSR pop-up doesn't repaint the screen upon exit.
  53.  
  54.          The EDB options commands are as follows:
  55.  
  56.              Exit - Exit the current session and return to the dos 
  57.                      prompt.
  58.              
  59.              Add - This function places the user in the first field of 
  60.                      the form and accepts data until the user exits the 
  61.                      form.   The data is then stored as the next entry in 
  62.                      the database.  If the specified database file does 
  63.                      not exist then EDB will issue an error and toss the 
  64.                      entered data.  If a database does not exist the add 
  65.                      function does NOT try to create it. 
  66.              
  67.              Create - This option is used to create a new database file. 
  68.                      The cursor will be placed in the form at the 
  69.                      location of the field used to hold the filename.  
  70.                      After the user provides a filename EDB will create a 
  71.                      file of the form <filename>.EDB and put a standard 
  72.                      EDB header on the file.  This option must be used 
  73.                      before an add may be performed.  If the named file 
  74.                      already exists then EDB will not create the new 
  75.                      database file.
  76.              
  77.              Search - This option puts the user in the form and lets him 
  78.                      enter data into any/all/none of the fields.  After 
  79.                      the user exits the form any fields that had data 
  80.                      entered in them will be used for search criteria.  
  81.                      The only field that requires a value to be entered 
  82.                      is the field that holds the database file name.  If 
  83.                      the rest of the fields are left blank then all rows 
  84.                      will be found.
  85.                           
  86.              Modify - After a search has completed, the retrieved data 
  87.                      may be modified with this command.  The user will be 
  88.                      placed in the form and allowed to edit any field 
  89.                      desired.  If the user edits the name of the database 
  90.                      file then EDB will try to add the entry to the newly 
  91.                      named file, if it exists.  If it writes the entry to 
  92.                      the new file then it will also set the delete bit on 
  93.                      the entry in the old file.
  94.              
  95.              Next - Moves to the next row found by search or find.
  96.              
  97.              Previous - Moves to the previous row found by search or 
  98.                      find.
  99.              
  100.              Delete - This row will set the delete bit for the current 
  101.                      record.  It will first ask for confirmation before 
  102.                      marking the record as deleted.
  103.              
  104.              Report - This row will prompt for a file name and then write 
  105.                      a copy of each record in the current search list to 
  106.                      the file.  If no file name is given EDB will default 
  107.                      to <formname.RPT>.  There are two choices for the 
  108.                      format of the report.  You may select either a comma 
  109.                      separated list or a file with one line for each 
  110.                      field using a "<field prompt>: <data value>" format.
  111.              
  112.              Compress - This option will compress a database file by 
  113.                      removing all entries with the delete bit set.  It 
  114.                      does this by creating a temporary file and reading 
  115.                      all non-deleted entries to that file.  Upon 
  116.                      successful completion EDB will then rename the old 
  117.                      database to <filename.old> and rename the temporary 
  118.                      file to <filename.EDB>.  Thus if there are any 
  119.                      errors during the compression the original file will 
  120.                      be left intact and in place.
  121.              
  122.              Find - This option is the same as search with one exception.  
  123.                      This command will find matching entries even if they 
  124.                      are marked as deleted.
  125.              
  126.              Undelete - This is the opposite of delete.  If a row is 
  127.                      deleted by mistake or for any reason needs to be 
  128.                      made active after a deletion this option will clear 
  129.                      the delete bit for that row.  The find command must 
  130.                      be used to locate a deleted row since search ignores 
  131.                      deleted records. 
  132.     
  133.          When entering data into fields EDB requires that a carriage 
  134.     return be entered for the data to be accepted.  To exit a form the 
  135.     user must enter an escape character as the first character in a 
  136.     field.  If the user enters ANY character after a normal displayable 
  137.     character in a field, that character will be accepted as data.  To 
  138.     exit a form the user must enter a carriage return to get to the next 
  139.     field if any data has been entered in the current field.  Then an 
  140.     escape may be entered to keep the data or a CNTRL-C may be entered to 
  141.     cancel the current operation.
  142.  
  143.  
  144.     Section Two: Form File Syntax
  145.  
  146.  
  147.          The form file is a simple ascii file that describes how to draw 
  148.     the screen.  Any form of white space may separate the fields in the 
  149.     form file.  A form field description may contain several fields in 
  150.     the form file.
  151.  
  152.          The first field of the file is a single integer.  This is the 
  153.     number of form fields described in the file.  The rest of the file 
  154.     describes the actual fields of the database.
  155.  
  156.          There are six different types of form fields.  Each form field 
  157.     definition starts with a letter that identifies that fields type.  
  158.     The letters are "a", "d", "i", "l", "D", and "T".
  159.          
  160.          After the identifying character each field description is 
  161.     followed by an x and y coordinate value.  These two values tell EDB 
  162.     were on the screen to put the first character of the fourth parameter 
  163.     of the field.
  164.          
  165.          The fourth parameter is a quoted text string.  In most cases 
  166.     this string acts as a prompt for the field.  In one case this string 
  167.     is just static information to display at some point on the screen.  
  168.     If you don't want a prompt then define this as a null field (ie. "").
  169.  
  170.          Some fields require a fifth parameter.  This is a data type 
  171.     parameter.  It tells what kind of data the field holds.  Valid 
  172.     values for this option are:
  173.              i   -   An integer value.  All integers are stored as a 32 
  174.                      bit value in the database.
  175.              f   -   A floating point value.  All floating point numbers
  176.                      are stored as doubles.
  177.              s   -   A string.  Strings are stored at whatever length the 
  178.                      field is defined to be, padded if needed.
  179.  
  180.          The sixth parameter, for fields that need it, is the field length.  
  181.     It defines the number of characters allocated on the screen for a 
  182.     field.
  183.  
  184.          Please examine the sample form files delivered with this product 
  185.     for examples on how to implement a form file.  The syntax for each 
  186.     field type follows.
  187.  
  188.          Type = a                                                       
  189.              Syntax - a <x> <y> <"prompt"> <data_type> <length>          
  190.                  This is a special field.  There may be only one in any 
  191.                  form.  Each time you add a new record to a database with 
  192.                  this field in the form, this field will automatically 
  193.                  increment.  This field must be of data_type integer.  
  194.                  When modifying records created with a form using this 
  195.                  field, this field may not be modified. 
  196.  
  197.          Type = d                                                      
  198.              Syntax - d <x> <y> <"prompt"> <data_type> <length> [places] 
  199.                  This is a standard data field.  Most fields in a form 
  200.                  will be of this type.  These fields can have a data_type 
  201.                  of integer, floating point, or string.  If this field 
  202.                  has a data_type of floating point then you must also 
  203.                  specify the number of decimal places to display on the 
  204.                  screen.  Otherwise the "places" parameter is left blank.
  205.          
  206.          Type = i                                                      
  207.              Syntax - i <x> <y> <"text">                               
  208.                  This is a static information field.  It is used to place 
  209.                  a string of text on the screen that will not change.  It 
  210.                  is useful for placing a name over a subsection of a 
  211.                  form. 
  212.  
  213.          Type = l                                                      
  214.              Syntax - l <x> <y> <"prompt">                               
  215.                  This is a location field.  It is used to hold the name 
  216.                  of the database file to use.  The idea here being that 
  217.                  the same form can be used with several files.  Note 
  218.                  however, when doing a search or find only one filename 
  219.                  can be used.  Searching of multiple files is planned as 
  220.                  a future feature.  Each form may contain only one 
  221.                  location field.
  222.          
  223.          Type = D                                                      
  224.              Syntax - D <x> <y> <"prompt">                               
  225.                  This is a date field.  It holds a four byte structure 
  226.                  that is a date.  If the first and only character entered 
  227.                  in this field is a "T", then EDB will return the current 
  228.                  date.  The way the date is displayed is dependent on 
  229.                  your country code.  If you don't have country.sys 
  230.                  running or country is set to U.S. then the date is 
  231.                  displayed as "mm/dd/yy".  The date will display as 
  232.                  "dd/mm/yy" for european users and as "yy/mm/dd" for 
  233.                  asian user if country.sys is properly installed.  Please 
  234.                  note that you must enter a date in the same format it is 
  235.                  displayed in or EDB will get confused.  At this time 
  236.                  there is no check to insure a valid date. 
  237.          
  238.          Type = T                                                      
  239.              Syntax - T <x> <y> <"prompt">                               
  240.                  This is a time field.  It is identical to the date field 
  241.                  but holds a time stamp instead.  As with the date field, 
  242.                  a "T" will return the current system time. 
  243.  
  244.          Now for the limiting factors.
  245.  
  246.          No more than thirty-two fields per form.
  247.  
  248.          No more than one screen per form.  In other words, your form 
  249.     cannot be more than eighteen lines long.  However, this is something 
  250.     I plan to change in the future.
  251.  
  252.          The suggested working area for the screen is from lines six 
  253.     through twenty-three inclusive.  And columns two through seventy-nine 
  254.     inclusive.
  255.  
  256.          Well, if you find any bugs or problems let me know.  Also if you 
  257.     have any suggestions or ideas feel free to send them to me also.
  258.  
  259.          My INTERNET address is:
  260.  
  261.                  hande@infonode.ingr.com
  262.  
  263.