home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / pcmag / vol12n03.zip / FAMILY.SC < prev    next >
Text File  |  1992-04-15  |  5KB  |  134 lines

  1. ;--------------------------------------------------------------------------
  2. ; FAMILY.SC - Prints the structure of all Paradox data bases (*.db) in
  3. ;             the current directory, along with listing of family members.
  4. ;             For Forms and Tables, the description is printed along with
  5. ;             the form/report number.
  6. ;--------------------------------------------------------------------------
  7. CLEARALL
  8.  
  9. printok = PRINTERSTATUS()                        ;make sure printer is on
  10. If printok THEN                                  ;printer is on, so go
  11.    STYLE REVERSE                                 ;put message on screen
  12.    @24,0
  13.    ?? FORMAT("W80,ac","Printing Table Documentation")
  14.    {Tools} {Info} {Inventory} {Tables} {}        ;get List of tables
  15.    EDIT "list"
  16.    OPEN PRINTER
  17.    cur_rec = 1
  18.    While cur_rec <= NRECORDS("list")             ;cycle through list of tables
  19.       MOVETO RECORD cur_rec                      ;  but don't include the Pdox
  20.       If    [Name] = "Answer"                    ;  temporary tables
  21.          OR [Name] = "Struct"
  22.          OR [Name] = "List"
  23.          OR [Name] = "Family"
  24.          OR [Name] = "Keyviol"
  25.          OR [Name] = "Inserted"
  26.          OR [Name] = "Changed"
  27.          OR [Name] = "Crosstab"
  28.          OR [Name] = "Deleted"
  29.          OR [Name] = "Entry"
  30.          THEN
  31.          cur_rec = cur_rec + 1
  32.          Loop
  33.       EndIf
  34.       cur_name = [Name]
  35.       DO_IT!
  36.       MENU {Tools} {Info} {Structure}            ;get structure of each table
  37.       SELECT cur_name                            ;  and start printing
  38.       PRINT  " \n\r"
  39.       PRINT  "     " + cur_name + " Table\n\r"
  40.       PRINT  " \n\r"
  41.       PRINT  "     Field Name                 Field Type\n\r"
  42.       PRINT  "     -------------------------  ----------\n\r"
  43.       field_nbr = 1
  44.       While field_nbr <= NRECORDS("struct")
  45.          MOVETO RECORD field_nbr
  46.          PRINT  "     " + [Field Name] +
  47.          SPACES(27-LEN([Field Name])) + [Field Type] + "\n\r"
  48.          field_nbr = field_nbr + 1
  49.       EndWhile
  50.       PRINT  " \n\r"                             ;two line feeds for spacing
  51.       PRINT  " \n\r"
  52.       MENU {Tools} {Info} {Family}               ;get family info for each table
  53.       SELECT cur_name
  54.       PRINT  "     Family Members \n\r"
  55.       PRINT  "     --------------------------------------------------- \n\r"
  56.       field_nbr = 1
  57.       MOVETO RECORD field_nbr
  58.       While field_nbr <= NRECORDS("family")
  59.          While SEARCH("Form",[Name]) = 1         ;this gets info on all Forms
  60.             If [Name] = "Form F" THEN            ;this is default Form
  61.                MENU {Forms} {Change}
  62.                SELECT cur_name
  63.                SELECT "F"
  64.                frdesc = MENUCHOICE()
  65.                MENU ESC
  66.                PRINT "     " + [Name] + " -- " + frdesc
  67.                PRINT "\n\r"
  68.                field_nbr = field_nbr + 1
  69.                MOVETO RECORD field_nbr
  70.             EndIf
  71.             For ndx FROM 1 To 14 STEP 1
  72.                If [Name] = "Form F" + strval(ndx) THEN    ;gets numbered forms
  73.                   MENU {Forms} {Change}
  74.                   SELECT cur_name
  75.                   SELECT ndx
  76.                   frdesc = MENUCHOICE()
  77.                   MENU ESC
  78.                   PRINT "     " + [Name] + " -- " + frdesc
  79.                   PRINT "\n\r"
  80.                   field_nbr = field_nbr + 1
  81.                   MOVETO RECORD field_nbr
  82.                EndIf
  83.             EndFor
  84.             If ATLAST() THEN
  85.                QuitLoop
  86.             EndIf
  87.          EndWhile
  88.          While SEARCH("Report",[Name]) = 1       ;gets Report info
  89.             If [Name] = "Report R" THEN
  90.                MENU {Report} {Change}
  91.                SELECT cur_name
  92.                SELECT "R"
  93.                frdesc = MENUCHOICE()
  94.                MENU ESC
  95.                PRINT "     " + [Name] + " -- " + frdesc
  96.                PRINT "\n\r"
  97.                field_nbr = field_nbr + 1
  98.                MOVETO RECORD field_nbr
  99.             EndIf
  100.             For ndx FROM 1 To 14 STEP 1
  101.                If [Name] = "Report R" + strval(ndx) THEN
  102.                   MENU {Report} {Change}
  103.                   SELECT cur_name
  104.                   SELECT ndx
  105.                   frdesc = MENUCHOICE()
  106.                   MENU ESC
  107.                   PRINT "     " + [Name] + " -- " + frdesc
  108.                   PRINT "\n\r"
  109.                   field_nbr = field_nbr + 1
  110.                   MOVETO RECORD field_nbr
  111.                EndIf
  112.             EndFor
  113.             If ATLAST() THEN
  114.                QuitLoop
  115.             EndIf
  116.          EndWhile
  117.          If SEARCH("Form",[Name]) = 0 and search("Report",[Name]) = 0 THEN
  118.             If field_nbr=1 THEN PRINT "     " + [Name] + " -- Table name \n\r"
  119.             Else PRINT "     " + [Name] + "\n\r"
  120.             EndIf
  121.             field_nbr = field_nbr + 1
  122.          EndIf
  123.          MOVETO RECORD field_nbr
  124.       EndWhile
  125.       UPIMAGE
  126.       UPIMAGE
  127.       cur_rec = cur_rec + 1
  128.       PRINT CHR(012)                             ;Page eject between tables
  129.    EndWhile
  130.    CLOSE PRINTER
  131.    RELEASE VARS ALL
  132.    CLEARALL
  133. EndIf
  134.