home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / decode10.zip / DBASE3.RUL < prev    next >
Text File  |  1992-12-07  |  3KB  |  107 lines

  1. ############################################################################
  2. #                                                                          #
  3. # dbase3.rul -- Decode It! rule file for dBASE III DBF files               #
  4. #               (dBASE is a registered trademark of Borland International) #
  5. #                                                                          #
  6. # Please note: This rule file is provided as an example only.  While       #
  7. #              every effort has been made to validate the information      #
  8. #              presented here, Axiom Innovations takes no responsibility   #
  9. #              for the integrity of the data that results from using       #
  10. #              this example.                                               #
  11. #                                                                          #
  12. ############################################################################
  13.  
  14. # dBASE III Header area
  15. RECORD  Header
  16.  
  17.   # Version should be equal to 3 or -125
  18.   XTINY  Version
  19.  
  20.   WHILE  Header.Version <> 3
  21.   BEGIN
  22.  
  23.     WHILE  Header.Version <> -125
  24.       EXIT
  25.  
  26.   END
  27.  
  28.   # Year of last edit date
  29.   TINY   Year
  30.  
  31.   # Month of last edit date
  32.   TINY   Month
  33.  
  34.   # Day of last edit date
  35.   TINY   Day
  36.  
  37.   # Number of records in the database
  38.   LONG   Record_Number
  39.  
  40.   # Length of header area
  41.   SHORT  Header_Length
  42.  
  43.   # Record size in bytes
  44.   SHORT  Record_Size
  45.  
  46.   # Reserved
  47.   TINY   Reserved  20
  48.   (OMIT0) Header.Reserved
  49.  
  50. END
  51.  
  52.  
  53. # Field definitions
  54. WHILE  .OFFSET  <  Header.Header_Length
  55.   RECORD  Field  -1
  56.  
  57.     # Field name, left justified, zero-filled
  58.     WHILE  Field.Name  <>  13
  59.       ASCII  Name  11
  60.     (OMIT0)  Field.Name
  61.  
  62.     # CR is the End of Fields marker
  63.     WHILE  Field.Name  <=>  13
  64.       BREAK
  65.  
  66.     # Field type: C, N, L, D, or M
  67.     ASCII   Type
  68.   
  69.     # Field data address (not very useful).
  70.     XLONG   Address
  71.  
  72.     # Field length
  73.     TINY    Length 
  74.  
  75.     # Number of decimals
  76.     TINY    Decimal_Digits
  77.  
  78.     # Reserved
  79.     TINY    Reserved  14
  80.     (OMIT0)  Field.Reserved
  81.  
  82.   END
  83.  
  84.  
  85. WHILE  .OFFSET  <  Header.Header_Length
  86.   TINY unused -1
  87. (OMIT0) unused
  88.  
  89. # Actual database
  90. RECORD  DBASE3_Record  Header.Record_Number
  91.  
  92.   # Deleted records contain an asterisk ('*') in first byte
  93.   # Normal records contain a space in first byte
  94.   ASCII  Deleted_Flag
  95.  
  96.   ASCII  Info  -1
  97.  
  98. END  Header.Record_Size
  99.  
  100.  
  101. # End of file
  102. TINY  EndOfFile
  103.  
  104.  
  105. EXIT
  106.  
  107.