home *** CD-ROM | disk | FTP | other *** search
/ Lion Share / lionsharecd.iso / utils_mz / v11n05.zip / DD.SC < prev    next >
Text File  |  1991-11-25  |  2KB  |  48 lines

  1. ;---------------------------------------------------------------------
  2. ; DD.SC                                                 Paradox 3.5
  3. ; Create a table structure dictionary for the current directory.
  4. ;---------------------------------------------------------------------
  5. IF NOT ISFILE("DD.DB")                ; If file not found, error
  6.    THEN
  7.    QUIT "File DD.DB not found."
  8. ELSE
  9.    EMPTY "DD"                        ; Empty the dictionary table
  10.    MESSAGE "DD: Creating table structure dictionary.."
  11. ENDIF
  12. CANVAS OFF
  13. SETDIR DIRECTORY()                     ; Get rid of temporary tables
  14.                                        ;  and clear workspace
  15. MENU {Tools} {Info}
  16. {Inventory} {Tables} {}                ; Get a list of tables in current
  17. RENAME "List" "Tables"                 ;  directory and rename it
  18. QUERY
  19.  Tables | Name       |                 ; Removes List and Dd from the
  20.  delete | List OR Dd |                 ;   table of table names
  21. ENDQUERY
  22. DO_IT!                                 ; Do the query
  23. MOVETO 1                               ; Move to first image on workspace
  24. CLEARIMAGE                             ; Remove the query image
  25. numrec = NRECORDS("Tables")            ; Get number of tables
  26. FOR count FROM 1 TO numrec             ; Loop through each entry
  27.    MOVETO "Tables"                     ; Move to the "Tables" Image
  28.    MOVETO RECORD count                 ; Move to the next record
  29.    tabname = [name]                    ; Assign table name to tabname
  30.    MENU {Tools} {Info} {Structure}     ; Get the structure of the table
  31.    SELECT tabname                      ;   in table STRUCT
  32.    QUERY                               ; Insert the table name, field
  33.                                        ;   and field type into DD table
  34.        Dd     | Table Name | Field Name | Field Type |
  35.        insert | ~tabname   | _fn        | _ft        |
  36.  
  37.        Struct | Field Name | Field Type |
  38.               | _fn        | _ft        |
  39.    ENDQUERY
  40.    DO_IT!                              ; Do the query
  41. ENDFOR
  42. DELETE "Tables"                        ; Remove the table of tables
  43. SETDIR DIRECTORY()                     ; Get rid of temporary tables
  44.                                        ;  and clear workspace
  45. CANVAS ON
  46. MESSAGE "DD: Finished..."
  47. VIEW "DD"                              ; View the Dictionary table
  48.