Module Dd_debug.dg

     1// Project Object Structure
     2//   oDD_Debug is a ModalPanel
     3//     oDDCombo is a ComboForm
     4//     oCurRec is a Form
     5//     oFindCurRec is a Button
     6//     oDDRelatesTo is a ComboForm
     7//     oShouldSave is a CheckBox
     8//     oChangedState is a CheckBox
     9//     oAutoFill is a CheckBox
    10//     oFillFromTop is a CheckBox
    11//     oDDOrdering is a ComboForm
    12//     oInherit is a CheckBox
    13//     oTD is a TabDialog
    14//       oTP_Field_Values is a TabPage
    15//         oFieldsEdit is a Edit
    16//       oTP_Misc is a TabPage
    17//         oMiscEdit is a Edit
    18//     oFindCounts is a Group
    19//       oTestsCount is a Form
    20//       oFoundCount is a Form
    21//       oDifference is a Form
    22//       oClearCounts is a Button
    23//       oNonOptimalWarnings is a CheckBox
    24//       oNonOptFinds is a Form
    25//       oNonOptTb is a Textbox
    26//     oFindGp is a Group
    27//       oFindBgn is a Button
    28//       oFindPrev is a Button
    29//       oFindNext is a Button
    30//       oFindEnd is a Button
    31//       oFindIndex is a ComboForm
    32//     oCheckRentrancy is a CheckBox
    33//     oClearAll_bn is a Button
    34//     oClear_bn is a Button
    35//     oClose_bn is a Button
    36
    37// Register all objects
    38Register_Object oAutoFill
    39Register_Object oChangedState
    40Register_Object oCheckRentrancy
    41Register_Object oClear_bn
    42Register_Object oClearAll_bn
    43Register_Object oClearCounts
    44Register_Object oClose_bn
    45Register_Object oCurRec
    46Register_Object oDD_Debug
    47Register_Object oDDCombo
    48Register_Object oDDOrdering
    49Register_Object oDDRelatesTo
    50Register_Object oDifference
    51Register_Object oFieldsEdit
    52Register_Object oFillFromTop
    53Register_Object oFindBgn
    54Register_Object oFindCounts
    55Register_Object oFindCurRec
    56Register_Object oFindEnd
    57Register_Object oFindGp
    58Register_Object oFindIndex
    59Register_Object oFindNext
    60Register_Object oFindPrev
    61Register_Object oFoundCount
    62Register_Object oInherit
    63Register_Object oMiscEdit
    64Register_Object oNonOptFinds
    65Register_Object oNonOptimalWarnings
    66Register_Object oNonOptTb
    67Register_Object oShouldSave
    68Register_Object oTD
    69Register_Object oTestsCount
    70Register_Object oTP_Field_Values
    71Register_Object oTP_Misc
    72
    73
    74// dd_debug.dg - DDO debugger/inspector for VDF10.0
    75//
    76// Copyright Data Access WorldWide 2003
    77// John Tuohy
    78//
    79// By adding this to any Windows view or application (with a "use DD_Debug.dg") you can
    80// inspect your DDOs and make sure they are doing what you think. To invoke this panel you
    81// need to press ctrl/d (or send DebugDDs).
    82//
    83// As of 9.1, this also tests for sending reentrant messages to the DDO when the DDO is busy.
    84// Normally, these messages are ignored - now you get an error message (so you can fix it).
    85// Also, you can set a limit for number of filtered records so you can see if you are using
    86// optimized and non-optimized indexes the way you think you are.
    87//
    88// NOTE: This package should NEVER appear in a deployed application. It is just for your
    89//       own development and testing.
    90
    91
    92
    93Validate_Packages 9 1 0
    94
    95Define CR_LF for (Character(13)+Character(10))
    96
    97// This provides support for DDO Rentancy checking and for testing for
    98// non-optimal finding.
    99Use DD_OperationChecker.pkg
   100
   101Procedure EnumerateDDs for DataDictionary integer iMsg integer hId
   102    Send iMsg of hID Self
   103End_Procedure
   104
   105
   106
   107Use Windows.pkg
   108Use dfCmbFrm.pkg
   109Use dfTabDg.pkg
   110Use DataDict.pkg
   111
   112
   113
   114
   115Object oDD_Debug is a ModalPanel
   116
   117    Property handle phoInvokingView    0
   118    Property handle phoCurrentDD       0
   119    Property handle phoFieldsEditId    0
   120    Property handle phoMiscEditId      0
   121
   122    Set Locate_mode to Center_on_screen
   123
   124    On_key kCancel Send Close_Panel
   125
   126    Function IsRecnumTable integer iFile Returns boolean
   127        Boolean bRecnumTable
   128        Get_Attribute DF_FILE_RECNUM_TABLE of iFIle to bRecnumTable
   129        Function_Return bRecnumTable
   130    End_Function
   131
   132
   133
   134
   135    Set Minimize_Icon to FALSE
   136    Set Label to "Data Dictionary Inspector"
   137    Set Location to 7 6
   138    Set Size to 263 410
   139
   140
   141
   142
   143    Object oDDCombo is a ComboForm
   144
   145        Set Label to "Current DD:"
   146        Set Size to 13 86
   147        Set Location to 6 49
   148        Set Form_Border to 0
   149        Set Label_Col_Offset to 2
   150        Set Label_Justification_Mode to jMode_Right
   151
   152        set entry_state 0 to False
   153        set combo_sort_state to false
   154
   155        Procedure AddDDs integer hDD
   156            Integer iCnt
   157            String sName
   158            Get Combo_Item_Count to iCnt
   159            Get Object_label of hDD to sName
   160            Send Combo_Add_Item sName
   161            Set Aux_Value of (combo_data_object(self)) iCnt to hDD
   162            If (hDD=phoCurrentDD(self)) Set Value 0 to sName
   163        End_procedure
   164
   165        Procedure Fill_List
   166            Integer hVw
   167            Get phoInvokingView to hVw
   168            Send Combo_Delete_Data
   169            Broadcast Send EnumerateDDs to hVw msg_AddDDs Self
   170            //Set Value 0 to (Combo_value(self,0))
   171            Send onChange
   172        End_Procedure
   173
   174
   175        Procedure onChange
   176            Integer iItem hDD
   177            Get combo_item_matching (value(self,0)) to iItem
   178            if (iItem>=0) begin
   179               Get Aux_Value of (combo_data_object(self)) iItem to hDD
   180               Delegate Set phoCurrentDD to hDD
   181               Delegate Send RefreshNewDD
   182            end
   183        End_procedure
   184
   185    End_Object    // oDDCombo
   186
   187    Object oCurRec is a Form
   188
   189        Set Label to "Current Record"
   190        Set Size to 13 37
   191        Set Location to 6 190
   192        Set Label_Col_Offset to 2
   193        Set Label_Justification_Mode to jMode_Right
   194
   195        Set numeric_mask 0 to 8 0
   196
   197        Procedure NewRec // note that this is never used.
   198            Integer iRec iFile hDD
   199            Get phoCurrentDD to hDD
   200            if hDD Begin
   201               get value 0 to iRec
   202               Get Main_file of hDD to iFile
   203               Set_Field_Value iFile 0 to iRec  // compatibility w/ recnum
   204               send Find of hDD EQ 0
   205               Send refreshAll
   206            end
   207        End_procedure
   208
   209    End_Object    // oCurRec
   210
   211    Object oFindCurRec is a Button
   212
   213        Set Label to "Find"
   214        Set Size to 13 20
   215        Set Location to 6 230
   216
   217        Procedure OnClick
   218            Integer iRec iFile hDD
   219            Get phoCurrentDD to hDD
   220            if hDD Begin
   221               Get Main_file of hDD to iFile
   222               If (IsRecnumTable(self,iFile)) begin
   223                  Get value of oCurRec 0 to iRec
   224                  Set_Field_Value iFile 0 to iRec // compatibility w/ recnum
   225                  send Find of hDD EQ 0
   226                  Send refreshAll
   227               End
   228            end
   229        End_procedure
   230
   231    End_Object    // oFindCurRec
   232
   233    Object oDDRelatesTo is a ComboForm
   234
   235
   236        Set Label to "Related To File:"
   237        Set Size to 13 67
   238        Set Location to 6 332
   239        Set Form_Border to 0
   240        Set Label_Col_Offset to 2
   241        Set Label_Justification_Mode to jMode_Right
   242
   243        set entry_state 0 to False
   244        set combo_sort_state to false
   245
   246        Procedure Fill_List
   247            Integer hDD iCnt iLmt iFile hCDO iCFile
   248            String sName
   249            Send Combo_Delete_Data
   250            Get phoCurrentDD to hDD
   251            If hDD eq 0 Procedure_Return
   252            Get Constrain_file of hDD to iCFile
   253            Get Combo_data_object to hCDO
   254            Move (server_file_count(hDD)-1) to iLmt
   255            Send Combo_add_item "None"
   256            Set Aux_Value of hCDO 0 to iFile
   257            If iCFile eq 0 set Value 0 to "None"
   258            For iCnt from 0 to iLmt
   259                Get Server_File of hDD iCnt to iFile
   260                Get_Attribute DF_FILE_LOGICAL_NAME of iFile to sName
   261                Send Combo_add_item sName
   262                Set Aux_Value of hCDO (iCnt+1) to iFile
   263                If iFile eq iCFile set Value 0 to sName
   264            Loop
   265
   266        End_Procedure
   267
   268
   269        Procedure onChange
   270            Integer iItem iFile hDD
   271            Get phoCurrentDD to hDD
   272            If (hDD=0) Procedure_Return
   273            Get combo_item_matching (value(self,0)) to iItem
   274            if (iItem>=0) begin
   275               Get Aux_Value of (combo_data_object(self)) iItem to iFile
   276               Set constrain_file of hDD to iFile
   277               Send rebuild_constraints of hDD
   278               Delegate Send RefreshAll
   279            end
   280        End_procedure
   281
   282    End_Object    // oDDRelatesTo
   283
   284    Object oShouldSave is a CheckBox
   285
   286        set enabled_state to False
   287
   288
   289        Set Label to "Should Save"
   290        Set Size to 10 57
   291        Set Location to 22 49
   292
   293
   294
   295    End_Object    // oShouldSave
   296
   297    Object oChangedState is a CheckBox
   298
   299        set enabled_state to False
   300
   301
   302        Set Label to "Changed State"
   303        Set Size to 10 64
   304        Set Location to 22 115
   305
   306
   307
   308    End_Object    // oChangedState
   309
   310    Object oAutoFill is a CheckBox
   311        Set Label to "Auto-Fill"
   312        Set Size to 10 41
   313        Set Location to 22 231
   314
   315        Procedure Select_Toggling integer iItm integer bState
   316            forward send select_toggling iItm bState
   317            Set auto_fill_state of (phoCurrentDD(self)) to (checked_state(self))
   318        End_Procedure
   319
   320    End_Object    // oAutoFill
   321
   322    Object oFillFromTop is a CheckBox
   323        Set Label to "First-Rec Auto-fill"
   324        Set Size to 10 69
   325        Set Location to 35 231
   326
   327        Procedure Select_Toggling integer iItm integer bState
   328            forward send select_toggling iItm bState
   329            Set pbAutoFillFromFirst of (phoCurrentDD(self)) to (checked_state(self))
   330        End_Procedure
   331
   332    End_Object    // oFillFromTop
   333
   334    Object oDDOrdering is a ComboForm
   335        Set Label to "Ordering"
   336        Set Size to 13 67
   337        Set Location to 20 332
   338        Set Form_Border to 0
   339        Set Label_Col_Offset to 2
   340        Set Label_Justification_Mode to jMode_Right
   341
   342        Set entry_state 0 to False
   343        Set combo_sort_state to false
   344
   345        Procedure RefreshNewDD
   346            Integer hDD iFile iSegs iNdxs i
   347            Send Combo_Delete_Data
   348            Get phoCurrentDD to hDD
   349            If hDD Begin
   350               Send Combo_Add_Item "Best.-1"
   351               Send Combo_Add_Item "Index.0"
   352               Get Main_file of hDD to iFile
   353               Get_Attribute DF_FILE_LAST_INDEX_NUMBER of iFile to iNdxs
   354               For i from 1 to iNdxs
   355                  Get_Attribute DF_INDEX_NUMBER_SEGMENTS of iFile i to iSegs
   356                  If iSegs Send Combo_Add_Item ("Index."-string(i))
   357               Loop
   358            End
   359        End_procedure
   360
   361        Procedure Set Ordering integer iOrdr
   362           If iOrdr eq -1 Set Value 0 to "Best.-1"
   363           else Set Value 0 to ("Index."-string(iOrdr))
   364        end_procedure
   365
   366        Procedure OnChange
   367            Integer hDD
   368            String sVal
   369            Get value 0 to sVal
   370            get phoCurrentDD to hDD
   371            If hDD set Ordering of hDD to (mid(sVal, 10, pos(".",sVal)+1))
   372        End_procedure
   373
   374    End_Object    // oDDOrdering
   375
   376    Object oInherit is a CheckBox
   377        Set Label to "Inherit Constraints"
   378        Set Size to 10 73
   379        Set Location to 35 333
   380
   381        Procedure Select_Toggling integer iItm integer bState
   382            Integer hDD
   383            forward send select_toggling iItm bState
   384            Set pbInheritConstraints of (phoCurrentDD(self)) to (checked_state(self))
   385            Get phoCurrentDD to hDD
   386            If (hDD>0) Begin
   387                Send rebuild_constraints to hDD
   388            end
   389        End_Procedure
   390
   391    End_Object    // oInherit
   392
   393    Object oTD is a TabDialog
   394        Set Size to 137 389
   395        Set Location to 44 11
   396        Set Rotate_Mode to RM_Rotate
   397        Object oTP_Field_Values is a TabPage
   398            Set Label to "Field Values"
   399            Set Tab_ToolTip_Value to "DD Field Values"
   400            Object oFieldsEdit is a Edit
   401
   402                set wrap_state to False
   403                set read_only_state to True
   404                Set Typeface to "Courier"
   405                Set Fontsize to 14 8
   406
   407                property integer piEditCount  0
   408                property string  psEditValue  ''
   409
   410                delegate set phoFieldsEditId to self
   411
   412                Procedure delete_data
   413                    Forward Send delete_data
   414                    set piEditCount to 0
   415                    Set psEditValue to ''
   416                end_procedure
   417
   418                Procedure Insert string sVal
   419                     Integer i
   420                     If (sVal=CR_LF) Begin
   421                        get piEditCount to i
   422                        Set Value i to (psEditValue(Self))
   423                        set piEditCount to (i+1)
   424                        set psEditValue to ''
   425                     End
   426                     Else begin
   427                        Set psEditValue to (psEditValue(Self)+sVal)
   428                     End
   429                end_procedure
   430
   431
   432
   433                Set Size to 116 375
   434                Set Location to 4 4
   435
   436                Procedure RefreshAll
   437                    Integer hDD hRB iMax iItem iFile
   438                    Integer iOldErrorReport hOldErr
   439                    String sLine sFieldName sChanged sVld sFrnVld sVal
   440
   441                    get phoCurrentDD to hDD
   442                    get Record_Buffer of hDD to hRB
   443                    Get main_file of hDD to iFile
   444                    Set Dynamic_update_state to false
   445                    Send Delete_Data
   446
   447                    Get Error_Report_Mode of hDD to iOldErrorReport
   448                    Set Error_Report_Mode of hDD to DD_ERROR_NO_REPORT
   449                    Move Error_Object_id to hOldErr
   450                    Move hDD to Error_Object_id
   451
   452                    // Write the Header
   453                    Send Insert "Field          Chg Vld FrnVld Value"
   454                    Send Insert CR_LF
   455                    Send Insert "-----------------------------------------------------------------------------------------------------------"
   456                    Send Insert CR_LF
   457
   458                    // Write the bodies for the fields
   459                    Get Item_Count of hRB to iMax
   460                    Decrement iMax
   461                    For iItem From 0 to iMax
   462                        Get_Attribute DF_FIELD_NAME of iFile iItem to sFieldName
   463                        Move (Pad(sFieldName,15)) to sFieldName
   464                        Move (string(Item_Changed_State(hRB, iItem))) to sChanged
   465                        // this will test it as a standard validation
   466                        Move hDD to Operation_Origin
   467                        Move (If(Validate_Field(hDD,iItem),"N","Y")) to sVld
   468                        // this will test it as a foreign validation
   469                        Move 0 to Operation_Origin
   470                        Move (If(Validate_Field(hDD,iItem),"N","Y")) to sFrnVld
   471                        //              Print (Item_Entry_MSG(hRB, iItem))
   472                        //              Print (Item_Exit_MSG(hRB, iItem))
   473                        //              Print (Item_Validate_MSG(hRB, iItem))
   474                        Move (Field_Current_Value(hDD, iItem)) to sVal
   475                        Move (sFormat("%1 %2   %3   %4     %5", sFieldName, sChanged, sVld, sFrnVld, sVal)) to sLine
   476                        Send Insert sLine
   477                        Send Insert CR_LF
   478                    Loop
   479                    Send Insert CR_LF
   480                    Send Insert "Existing_Key_Value = "
   481                    Send Insert (Existing_Key_Value(hDD))
   482                    Send Insert CR_LF
   483
   484                    Send Beginning_of_Data
   485                    Set Dynamic_update_state to true
   486                    Set Error_Report_Mode of hDD to iOldErrorReport
   487                    Move hOldErr to Error_Object_id
   488                End_procedure
   489
   490
   491            End_Object    // oFieldsEdit
   492
   493        End_Object    // oTP_Field_Values
   494
   495        Object oTP_Misc is a TabPage
   496            Set Label to "Misc"
   497            Set Tab_ToolTip_Value to "Other DD static values"
   498            Object oMiscEdit is a Edit
   499
   500                set wrap_state to False
   501                set read_only_state to True
   502                Set Typeface to "Courier"
   503                Set Fontsize to 14 8
   504                property integer piEditCount  0
   505                property string  psEditValue  ''
   506
   507                delegate set phoMiscEditId to self
   508
   509                Procedure delete_data
   510                    Forward Send delete_data
   511                    set piEditCount to 0
   512                    Set psEditValue to ''
   513                end_procedure
   514
   515                Procedure Insert string sVal
   516                     Integer i
   517                     If (sVal=CR_LF) Begin
   518                        get piEditCount to i
   519                        Set Value i to (psEditValue(Self))
   520                        set piEditCount to (i+1)
   521                        set psEditValue to ''
   522                     End
   523                     Else Begin
   524                        Set psEditValue to (psEditValue(Self)+sVal)
   525                    end
   526                end_procedure
   527
   528                Procedure RefreshAll
   529                    Integer hDD hRB iMax iItem iFile iFIl iObj iOldSt
   530                    Integer iCnt hVw iBase iType iFAObj iOldErrorReport hOldErr
   531                    String sDummy sView sName sDummy2 sFieldName sType sLine
   532
   533                    Get phoInvokingView to hVw
   534                    Get Name of hVw to sView
   535
   536                    get phoCurrentDD to hDD
   537                    get Record_Buffer    of hDD to hRB
   538                    get Field_Attributes of hDD to iFAObj
   539                    Get main_file of hDD to iFile
   540                    Set Dynamic_update_state to false
   541                    Send Delete_Data
   542
   543                    Send Insert "Current DDO Container = "
   544                    Send Insert (Object_Label(hVw) * string(hVw) * sView)
   545                    Send Insert CR_LF
   546                    Send Insert CR_LF
   547
   548                    //Send Insert "Keys_Fields = "
   549                    //Send Insert (Key_Fields(hDD))
   550                    //Send Insert CR_LF
   551
   552                    Send Insert "Protect_Key_State = "
   553                    Send Insert (If(Protect_Key_State(hDD),"True","False"))
   554                    Send Insert CR_LF
   555
   556                    Send Insert "Cascade_Delete_State = "
   557                    Send Insert (If(Cascade_Delete_State(hDD),"True","False"))
   558                    Send Insert CR_LF
   559                    Send Insert CR_LF
   560
   561                    Send Insert "Required Server Files = "
   562                    Send Insert (Server_File_Count(hDD))
   563                    Send Insert CR_LF
   564                    For iCnt from 0 to (Server_File_Count(hDD)-1)
   565                        Get Server_File of hDD iCnt to iFil
   566                        Send Insert ("     " +string(iFil)+" - ")
   567                        Get_Attribute DF_FILE_LOGICAL_NAME of iFil to sDummy
   568                        Send Insert sDummy
   569                        Send Insert CR_LF
   570                    Loop
   571                    Send Insert  CR_LF
   572
   573                    Send Insert "Required Client Files = "
   574                    Send Insert (Client_File_Count(hDD))
   575                    Send Insert CR_LF
   576                    For iCnt from 0 to (Client_File_Count(hDD)-1)
   577                        Get Client_File of hDD iCnt to iFil
   578                        Send Insert ("     " +string(iFil)+" - ")
   579                        Get_Attribute DF_FILE_LOGICAL_NAME of iFil to sDummy
   580                        Send Insert sDummy
   581                        Send Insert CR_LF
   582                    Loop
   583                    Send Insert  CR_LF
   584
   585                    Send Insert "Required Other Files = "
   586                    Send Insert (System_File_Count(hDD))
   587                    Send Insert CR_LF
   588                    For iCnt from 0 to (System_File_Count(hDD)-1)
   589                        Get System_File_Number of hDD iCnt to iFil
   590                        Send Insert ("     " +string(iFil)+" - ")
   591                        Get_Attribute DF_FILE_LOGICAL_NAME of iFil to sDummy
   592                        Send Insert sDummy
   593                        Get System_File_Lock_Mode of hDD iCnt to iFil
   594                        Case Begin
   595                            case (iFil=DD_Lock_on_All)             Move " - Lock on all" to sDummy
   596                            case (iFil=DD_Lock_on_Delete)          Move " - Lock on Delete" to sDummy
   597                            case (iFil=DD_Lock_on_new_Save_delete) Move " - Lock on new save/delete" to sDummy
   598                            case (iFil=DD_Lock_on_Save)            Move " - Lock on save" to sDummy
   599                            case (iFil=DD_Lock_on_new_Save)        Move " - Lock on new save" to sDummy
   600                            case else                              Move " - No Lock" to sDummy
   601                        case end
   602                        Send Insert sDummy
   603                        Send Insert CR_LF
   604                    Loop
   605                    Send Insert  CR_LF
   606
   607                    Send Insert "Attached DDO Server DDO = "
   608                    Send Insert (Data_set_server_Count(hDD))
   609                    Send Insert CR_LF
   610                    For iCnt from 0 to (Data_set_server_Count(hDD)-1)
   611                        Get Data_Set_Server of hDD iCnt to iObj
   612                        Get Main_file of iObj to iFil
   613                        Move (replace(sView+".",Name(iObj),"")) to sName
   614                        Send Insert ("     " +string(iObj)+" - "+sname)
   615                        Send Insert ("     " +string(iFil)+" - ")
   616                        Get_Attribute DF_FILE_LOGICAL_NAME of iFil to sDummy
   617                        Send Insert sDummy
   618                        Send Insert CR_LF
   619                    Loop
   620                    Send Insert  CR_LF
   621
   622                    Send Insert "Attached DDO CLient DDOs = "
   623                    Send Insert  (Data_set_Client_Count(hDD))
   624                    Send Insert  CR_LF
   625                    For iCnt from 0 to (Data_set_Client_Count(hDD)-1)
   626                        Get Data_Set_Client of hDD iCnt to iObj
   627                        Get Main_file of iObj to iFil
   628                        Move (replace(sView+".",Name(iObj),"")) to sName
   629                        Send Insert ("     " +string(iObj)+" - "+sname)
   630                        Send Insert ("     " +string(iFil)+" - ")
   631                        Get_Attribute DF_FILE_LOGICAL_NAME of iFil to sDummy
   632                        Send Insert sDummy
   633                        Send Insert CR_LF
   634                    Loop
   635                    Send Insert CR_LF
   636
   637                    Send Insert  "Valid Save Structure = "
   638                    Send Insert  (if(Validate_Save_Structure(hDD,1),"No","Yes"))
   639                    Send Insert  CR_LF
   640
   641                    Get Cascade_delete_State of hDD to ioldst
   642                    Set Cascade_delete_State of hDD to TRUE
   643                    Send Insert  "Valid Cascade Delete Structure = "
   644                    Send Insert  (if(Validate_Delete_Structure(hDD,1),"No","Yes"))
   645                    Send Insert  CR_LF
   646
   647                    Set Cascade_delete_State of hDD to False
   648                    Send Insert  "Valid No Cascade Delete Structure = "
   649                    Send Insert  (if(Validate_Delete_Structure(hDD,1),"No","Yes"))
   650                    Send Insert  CR_LF
   651                    Set Cascade_delete_State of hDD to ioldst
   652
   653                    Send Insert  CR_LF
   654                    Send Insert  "Attached DEOs = "
   655                    Send Insert  (Data_set_user_Interface_Count(hDD))
   656                    Send Insert  CR_LF
   657                    For iCnt from 0 to (Data_set_User_Interface_Count(hDD)-1)
   658                        Get Data_Set_User_Interface of hDD iCnt to iObj
   659                        Move (replace(sView+".",Name(iObj),"")) to sName
   660                        Send Insert ("     " +string(iObj)+" - "+sname)
   661                        If Not (Extended_deo_State(iObj)) Send Insert  ("  (**Not XDEO)")
   662                        else If (Data_File(iObj,0)<>iFile) Send Insert  ("    (foreign)")
   663
   664                        Send Insert  CR_LF
   665                    Loop
   666                    Send Insert  CR_LF
   667
   668                    // Write the bodies for the fields
   669                    // Write the Header
   670                    Send Insert "              Extended Field Attributes"
   671                    Send Insert CR_LF
   672                    Send Insert "Field           Type             Valid Values"
   673                    Send Insert CR_LF
   674                    Send Insert "-----------------------------------------------------------------------------------------------------------"
   675                    Send Insert CR_LF
   676
   677                    Get Error_Report_Mode of hDD to iOldErrorReport
   678                    Set Error_Report_Mode of hDD to DD_ERROR_NO_REPORT
   679                    Move Error_Object_id to hOldErr
   680                    Move hDD to Error_Object_id
   681                    Get Item_Count of hRB to iMax
   682                    Decrement iMax
   683                    For iItem From 0 to iMax
   684                        Move (iItem * FA_COUNT) to iBase
   685                        Get_Attribute DF_FIELD_NAME of iFile iItem to sFieldName
   686                        Move (pad(sFieldName,15)) to sFieldName
   687                        Get Field_Validation_Type of hDD iItem to sType
   688                        Case Begin
   689                            Case (iType=FA_VALIDATION_TYPE_RANGE)
   690                                Move "Range" to sDummy
   691                                Move ("Min="+Value(iFAObj,iBase+FA_MIN_VALUE) * ;
   692                                    "Max="+Value(iFAObj,iBase+FA_MAX_VALUE)) ;
   693                                        to sDummy2
   694                                Case Break
   695                            Case (iType=FA_VALIDATION_TYPE_CHECK)
   696                                Move "Check" to sDummy
   697                                Move ("Values =" * Value(iFAObj,iBase+FA_CHECK_VALUE)) to sDummy2
   698                                Case Break
   699                            Case (iType=FA_VALIDATION_TYPE_CHECKBOX)
   700                                Move "CheckBox" to sDummy
   701                                Move ("True="+ Value(iFAObj,iBase+FA_CHECKBOX_TRUE) * ;
   702                                    "False="+ Value(iFAObj,iBase+FA_CHECKBOX_FALSE)) ;
   703                                        to sDummy2
   704                                Case Break
   705                            Case (iType=FA_VALIDATION_TYPE_TABLE)
   706                                Move "Table" to sDummy
   707                                Move ("Id="+ Value(iFAObj,iBase+FA_TABLE_OBJECT) * ;
   708                                      Name( Value(iFAObj,iBase+FA_TABLE_OBJECT) )) ;
   709                                        to sDummy2
   710                                Case Break
   711                            Case Else
   712                                Move "None" to sDummy
   713                                Move "" to sDummy2
   714                        Case end
   715                        Move (Pad(sDummy,14)) to sDummy
   716                        Move (SFormat("%1 %2 %3 %4", sFieldName, sType, sDummy, sDummy2)) to sLine
   717                        Send Insert sLine
   718                        Send Insert  CR_LF
   719                    Loop
   720
   721                    Send Beginning_Of_Data
   722                    Set Dynamic_update_state to false
   723                    Set Error_Report_Mode of hDD to iOldErrorReport
   724                    Move hOldErr to Error_Object_id
   725                end_procedure
   726
   727
   728
   729                Set Size to 116 375
   730                Set Location to 4 4
   731
   732
   733
   734            End_Object    // oMiscEdit
   735
   736        End_Object    // oTP_Misc
   737
   738    End_Object    // oTD
   739
   740    Object oFindCounts is a Group
   741        Set Size to 40 390
   742        Set Location to 182 10
   743        Set Label to "Constraint Find Counts"
   744        Object oTestsCount is a Form
   745
   746            Set enabled_state to false
   747
   748            Set Label to "Tests_Count"
   749            Set Size to 13 37
   750            Set Location to 10 47
   751            Set Label_Col_Offset to 2
   752            Set Label_Justification_Mode to jMode_Right
   753
   754            Set Numeric_mask 0 to 8 0
   755
   756        End_Object    // oTestsCount
   757
   758        Object oFoundCount is a Form
   759
   760            Set enabled_state to false
   761
   762            Set Label to "Found_Count"
   763            Set Size to 13 37
   764            Set Location to 10 137
   765            Set Label_Col_Offset to 2
   766            Set Label_Justification_Mode to jMode_Right
   767
   768            Set Numeric_mask 0 to 8 0
   769
   770        End_Object    // oFoundCount
   771
   772        Object oDifference is a Form
   773
   774            Set enabled_state to false
   775
   776            Set Label to "Difference"
   777            Set Size to 13 37
   778            Set Location to 10 213
   779            Set Label_Col_Offset to 2
   780            Set Label_Justification_Mode to jMode_Right
   781
   782            Set Numeric_mask 0 to 8 0
   783
   784        End_Object    // oDifference
   785
   786        Object oClearCounts is a Button
   787
   788
   789
   790            Set Label to "Clear Count"
   791            Set Size to 13 50
   792            Set Location to 10 260
   793
   794            Procedure OnClick
   795                Send ClearCounts
   796            End_procedure
   797
   798
   799        End_Object    // oClearCounts
   800
   801        Object oNonOptimalWarnings is a CheckBox
   802            Set Label to "Report errors if more than"
   803            Set Size to 10 93
   804            Set Location to 24 6
   805
   806            Procedure OnChange
   807                Delegate Send SetNonOptimalWarnings
   808            End_Procedure // OnChange
   809
   810        End_Object    // oNonOptimalWarnings
   811
   812        Object oNonOptFinds is a Form
   813
   814            Set Numeric_mask 0 to 6 0
   815
   816            Set Size to 13 25
   817            Set Location to 24 104
   818
   819
   820            Set Value 0 to 50
   821
   822            Procedure OnChange
   823                Delegate Send SetNonOptimalWarnings
   824            End_Procedure // OnChange
   825
   826        End_Object    // oNonOptFinds
   827
   828        Object oNonOptTb is a Textbox
   829            Set Label to "records are filtered."
   830            Set Location to 25 132
   831            Set Size to 10 61
   832            Set TypeFace to "MS Sans Serif"
   833        End_Object    // oNonOptTb
   834
   835
   836        Procedure ClearCounts
   837            Move 0 to Constrain_tests_count
   838            Move 0 to Constrain_found_Count
   839            Send RefreshCounts
   840        End_procedure
   841
   842        procedure RefreshCounts
   843            Set Value of oTestsCount to constrain_tests_count
   844            Set Value of oFoundCount to constrain_Found_count
   845            Set Value of oDifference to (constrain_tests_count - Constrain_found_count)
   846        end_procedure
   847
   848
   849    End_Object    // oFindCounts
   850
   851    Object oFindGp is a Group
   852
   853
   854
   855        Set Size to 30 185
   856        Set Location to 225 10
   857        Set Label to "Find Record"
   858        Object oFindBgn is a Button
   859
   860
   861
   862            Set Label to "Button3"
   863            Set Size to 14 18
   864            Set Location to 10 9
   865            Set Bitmap to "bgn.bmp/3d/t"
   866
   867            Procedure OnClick
   868                Delegate Send FindRec FIRST_RECORD
   869            End_procedure
   870
   871
   872        End_Object    // oFindBgn
   873
   874        Object oFindPrev is a Button
   875
   876
   877
   878            Set Label to "Button3"
   879            Set Size to 14 18
   880            Set Location to 10 31
   881            Set Bitmap to "Prev.bmp/3d/t"
   882
   883            Procedure OnClick
   884                Delegate Send FindRec LT
   885            End_procedure
   886
   887
   888        End_Object    // oFindPrev
   889
   890        Object oFindNext is a Button
   891
   892
   893
   894            Set Label to "Button3"
   895            Set Size to 14 18
   896            Set Location to 10 53
   897            Set Bitmap to "next.bmp/3d/t"
   898
   899            Procedure OnClick
   900                Delegate Send FindRec Gt
   901            End_procedure
   902
   903
   904        End_Object    // oFindNext
   905
   906        Object oFindEnd is a Button
   907
   908
   909
   910            Set Label to "Button3"
   911            Set Size to 14 18
   912            Set Location to 10 75
   913            Set Bitmap to "end.bmp/3d/t"
   914
   915            Procedure OnClick
   916                Delegate Send FindRec LAST_RECORD
   917            End_procedure
   918
   919
   920        End_Object    // oFindEnd
   921
   922        Object oFindIndex is a ComboForm
   923
   924
   925
   926            Set Size to 13 85
   927            Set Location to 11 97
   928            Set Form_Border to 0
   929            Set Label_Col_Offset to 2
   930            Set Label_Justification_Mode to jMode_Right
   931
   932            Procedure Fill_list
   933                Integer hDD iFile iSegs iNdxs i
   934                Send Combo_Delete_Data
   935                Get phoCurrentDD to hDD
   936                If hDD Begin
   937                    Send Combo_Add_Item "Index.0"
   938                    Get Main_file of hDD to iFile
   939                    Get_Attribute DF_FILE_LAST_INDEX_NUMBER of iFile to iNdxs
   940                    For i from 1 to iNdxs
   941                        Get_Attribute DF_INDEX_NUMBER_SEGMENTS of iFile i to iSegs
   942                        If iSegs Send Combo_Add_Item ("Index."-string(i))
   943                    Loop
   944                End
   945                Set Value 0 to (combo_value(self,0))
   946            End_procedure
   947
   948            Function Ordering returns integer
   949                String sVal
   950                Get Value 0 to sVal
   951                Function_return (integer(mid(sVal, 10, pos(".",sVal)+1)))
   952            end_function
   953
   954        End_Object    // oFindIndex
   955
   956
   957        Procedure FindRec integer iMode
   958            Integer hDD iNdx
   959            Get Ordering of oFindIndex to iNdx
   960            Get phoCurrentDD to hDD
   961            If hDD Begin
   962                Send Find of hDD iMode iNdx
   963                Send RefreshAll
   964            End
   965        End_procedure
   966
   967         Procedure RefreshNewDD
   968             Send Fill_List of oFindIndex
   969         End_procedure
   970
   971    End_Object    // oFindGp
   972
   973    Object oCheckRentrancy is a CheckBox
   974        Set Label to "Report DD Rentrancy Errors"
   975        Set Size to 10 105
   976        Set Location to 224 294
   977
   978        Procedure OnChange
   979            Get Checked_State To gbTestRentrancy
   980        End_Procedure // OnChange
   981
   982    End_Object    // oCheckRentrancy
   983
   984    Object oClearAll_bn is a Button
   985
   986
   987
   988        Set Label to "Clear& All"
   989        Set Location to 241 242
   990
   991        Procedure OnClick
   992            Integer hDD
   993            get phoCurrentDD to hDD
   994            if hDD Send clear_all to hdd
   995            Send RefreshALL
   996        end_procedure
   997
   998    End_Object    // oClearAll_bn
   999
  1000    Object oClear_bn is a Button
  1001
  1002
  1003
  1004        Set Label to "&Clear"
  1005        Set Location to 241 295
  1006
  1007        Procedure OnClick
  1008            Integer hDD
  1009            get phoCurrentDD to hDD
  1010            if hDD Send clear to hdd
  1011            Send RefreshALL
  1012        end_procedure
  1013
  1014
  1015    End_Object    // oClear_bn
  1016
  1017    Object oClose_bn is a Button
  1018
  1019
  1020
  1021        Set Label to "&Close"
  1022        Set Location to 241 350
  1023
  1024        Procedure OnClick
  1025            Send Close_Panel
  1026        end_procedure
  1027
  1028
  1029    End_Object    // oClose_bn
  1030
  1031
  1032
  1033    Procedure RefreshAll
  1034        Integer hDD
  1035        Boolean bIsRecnumTable
  1036        get phoCurrentDD to hDD
  1037        Get IsRecnumTable (main_file(hDD)) to bIsRecnumTable
  1038        Set Value          of oCurRec 0 to (If(bIsRecnumTable, current_record(hDD), 0))
  1039        Set checked_state  of oChangedState to (Changed_State(hDD))
  1040        set checked_state  of oShouldSave   to (Should_save(hDD))
  1041        Send RefreshAll    of (phoFieldsEditId(self))
  1042        Send RefreshCounts of oFindCounts
  1043    End_procedure
  1044
  1045    Procedure SetNonOptimalWarnings
  1046        Integer iValue
  1047        Boolean bChecked
  1048        Get Checked_State of oNonOptimalWarnings to bChecked
  1049        Get Value of oNonOptFinds to iValue
  1050        Move (if(bChecked,iValue,0)) to giNonOptimalFindCount
  1051        Set Enabled_state of oNonOptFinds to bChecked
  1052    End_procedure
  1053
  1054    Procedure RefreshNewDD
  1055        Integer hDD
  1056        get phoCurrentDD to hDD
  1057        Send Fill_list of oDDRelatesTo
  1058        set checked_state of oAutoFill to (Auto_Fill_State(hDD)<>0)
  1059        set checked_state of oInherit  to (pbInheritConstraints(hDD))
  1060        set checked_state of oFillFromTop to (pbAutoFillFromFirst(hDD))
  1061        Send RefreshAll   to (phoMiscEditId(self))
  1062        Send RefreshAll
  1063
  1064        Send RefreshNewDD of oDDOrdering
  1065        Send RefreshNewDD of oFindGP
  1066        Set  Ordering     of oDDOrdering to (ordering(hDD))
  1067    End_procedure
  1068
  1069
  1070    Procedure refresh
  1071        Send Fill_list of oDDCombo
  1072        Send SetNonOptimalWarnings
  1073        set checked_state of oCheckRentrancy to gbTestRentrancy
  1074    end_procedure
  1075
  1076    Procedure ShowDDs Integer hoDD
  1077        Integer hoVw
  1078        Get parent of hoDD  to hoVw
  1079        Set phoCurrentDD    to hoDD
  1080        Set phoInvokingView to hoVw
  1081        Send Refresh
  1082        Send Popup
  1083    End_Procedure
  1084
  1085
  1086
  1087End_Object    // oDD_Debug
  1088
  1089
  1090
  1091Procedure DebugDDs FOR cObject
  1092   Integer hDD
  1093   get Server to hDD
  1094   if hDD Send ShowDDs of oDD_Debug hDD
  1095End_Procedure
  1096
  1097On_key key_Ctrl+Key_D Send DebugDDs
  1098