Register_Object oAppend_bn Register_Object oApply_bn Register_Object oApplyAllRows_bn Register_Object oASCII_fm Register_Object oBinary_fm Register_Object oChildFromFields_tb Register_Object oChildFromFields_tv Register_Object oChildToFields_tb Register_Object oChildToFields_tv Register_Object oClear_bn Register_Object oCollections_grp Register_Object oCollections_tb Register_Object oConstraints_grp Register_Object oConstraints_lst Register_Object oCurrentRecords_fm Register_Object oDate_fm Register_Object oDbTables_TD Register_Object oDbTabPage1 Register_Object oDbTabPage2 Register_Object oDbTabPage3 Register_Object oDbTabPage4 Register_Object oDbTabPage5 Register_Object oDbTabPage6 Register_Object oDbTabPage7 Register_Object oDbTabPage8 Register_Object oDefaultSchemeName_cf Register_Object oDefaults_grp Register_Object oDelete_bn Register_Object oDeleteLog_bn Register_Object oDeleteValueTable_bn Register_Object oDeselectAll_bn Register_Object oDummy_fm Register_Object oFieldNames_grd Register_Object oFieldRange_grp Register_Object oFields_cf Register_Object oFieldsMark_cf Register_Object oFindButton_c3d Register_Object oFindToolbar Register_Object oFirst_bn Register_Object oFlagField_grp Register_Object oFlags_lst Register_Object oFromChildFields_tb Register_Object oFromChildFields_tv Register_Object oFromDatabase_grp Register_Object oFromDataTable_fm Register_Object oFromDSN_grp Register_Object oFromField_cf Register_Object oFromFileDSN_bn Register_Object oFromIndex_grp Register_Object oFromIndexFields_tb Register_Object oFromIndexFields_tv Register_Object oFromLogin_bn Register_Object oFromODBCAdmin_bn Register_Object oFromODBCText Register_Object oFromParentFields_tb Register_Object oFromParentFields_tv Register_Object oFromPath_bn Register_Object oFromRadio1 Register_Object oFromRadio2 Register_Object oFromRadio3 Register_Object oFromRecordRefresh_bn Register_Object oFromStartField_cf Register_Object oFromStopField_cf Register_Object oGlobal_grp Register_Object oImage_lst Register_Object oImages Register_Object oImagesHot Register_Object oInfo_tb Register_Object oInfoValue_tb Register_Object oInvertSelection_bn Register_Object oLast_bn Register_Object oLength_fm Register_Object oLengthMark_fm Register_Object oLog_tp Register_Object oMatchingFields_grp Register_Object oMaxRecords_fm Register_Object oMode_cf Register_Object oNewValueTable_bn Register_Object oNext_bn Register_Object oNoOfFromRecords_fm Register_Object oNoOfMatchingNames_fm Register_Object oNoOfToRecords_fm Register_Object oNullDefaults_grp Register_Object oNumeric_fm Register_Object oParentFromFields_tb Register_Object oParentFromFields_tv Register_Object oParentToFields_tb Register_Object oParentToFields_tv Register_Object oPrev_bn Register_Object oProgramStart_grp Register_Object oRDS_td Register_Object oRdcView Register_Object oRemoveAllRows_bn Register_Object oRun_TP Register_Object oSave_bn Register_Object oScheduledTasks_bn Register_Object oScheduledTasksHelp_Bn Register_Object oSelect_bn Register_Object oSelectAll_bn Register_Object oSelectedFields_grp Register_Object oSelectMark_bn Register_Object oSelFromCount_fm Register_Object oSelToCount_fm Register_Object oSncLog_grd Register_Object oSnclog_Datetime Register_Object oSnclog_Networkusername Register_Object oSnclog_Statustext Register_Object oSnclog_Tablename Register_Object oSncSchem_cb Register_Object oSncSchem_grd Register_Object oSncsys_Allowautodelete Register_Object oSncsys_Allowcancelsent Register_Object oSncsys_Allowdeletelog Register_Object oSncsys_Allowtblchange Register_Object oSncsys_Dsn_Names Register_Object oSncsys_Runminimized Register_Object oSncsys_Show_Info Register_Object oSncTRow_Grid Register_Object oSncTRow_grp Register_Object oSnctable_Checkintegrity Register_Object oSnctable_Constraincount Register_Object oSnctable_Createdby Register_Object oSnctable_Datetime Register_Object oSnctable_Delete_Records Register_Object oSnctable_Editedby Register_Object oSnctable_Frfileoemtoansi Register_Object oSnctable_Fridxselcount Register_Object oSnctable_FromDataTable Register_Object oSnctable_Fromdatabase Register_Object oSnctable_FromdataTable_Conv Register_Object oSnctable_FromdataTable_Filter Register_Object oSnctable_FromdataTable_Index Register_Object oSnctable_FromdataTable_Mark Register_Object oSnctable_Fromdbtype Register_Object oSnctable_Fromdriver Register_Object oSnctable_Fromfilepath Register_Object oSnctable_Fromindex Register_Object oSnctable_Fromntauth Register_Object oSnctable_Fromowner Register_Object oSnctable_Frompv Register_Object oSnctable_Fromserver Register_Object oSnctable_Fromuser Register_Object oSnctable_Hide Register_Object oSnctable_Lastedited Register_Object oSnctable_Notes Register_Object oSnctable_Recid Register_Object oSnctable_Sncthea_Count Register_Object oSnctable_Sortfield Register_Object oSnctable_Synchflagcount Register_Object oSnctable_Synchtype Register_Object oSnctable_Text Register_Object oSnctable_ToDataTable Register_Object oSnctable_Todatabase Register_Object oSnctable_TodataTable_Conv Register_Object oSnctable_TodataTable_Index Register_Object oSnctable_TodataTable_Null Register_Object oSnctable_Todbtype Register_Object oSnctable_Todriver Register_Object oSnctable_Tofileoemtoansi Register_Object oSnctable_Tofilepath Register_Object oSnctable_Toidxselcount Register_Object oSnctable_Toindex Register_Object oSnctable_Tontauth Register_Object oSnctable_Toowner Register_Object oSnctable_Topv Register_Object oSnctable_Toserver Register_Object oSnctable_Touser Register_Object oSynchronizeProgram_bn Register_Object oTable_tp Register_Object oText_fm Register_Object oTextBox1 Register_Object oTextBox10 Register_Object oTextBox11 Register_Object oTextBox12 Register_Object oTextBox13 Register_Object oTextBox14 Register_Object oTextBox16 Register_Object oTextBox2 Register_Object oTextBox3 Register_Object oTextBox4 Register_Object oTextBox7 Register_Object oTextBox8 Register_Object oTextBox9 Register_Object oToChildFields_tb Register_Object oToChildFields_tv Register_Object oToDatabase_grp Register_Object oToDataTable_fm Register_Object oToDSN_grp Register_Object oToField_cf Register_Object oToFileDSN_bn Register_Object oToIndex_grp Register_Object oToIndexFields_tb Register_Object oToIndexFields_tv Register_Object oToLogin_bn Register_Object oToODBCAdmin_bn Register_Object oToODBCText Register_Object oToParentFields_tb Register_Object oToParentFields_tv Register_Object oToPath_bn Register_Object oToRadio1 Register_Object oToRadio2 Register_Object oToRadio3 Register_Object oToRecordRefresh_bn Register_Object oToStartField_cf Register_Object oTotFields_fm Register_Object oType_fm Register_Object oTypeMark_fm Register_Object oValue_fm Register_Object oValueFunction_cf Register_Object oValues_grd Register_Object oViewFromData_bn Register_Object oViewFromDataNullDefaults_bn Register_Object oViewToData_bn Register_Object Snclog_DD Register_Object Sncschem_DD Register_Object Sncsys_DD Register_Object Snctable_DD Register_Object Sncthea_DD Register_Object Snctrow_DD Use cControlPanel.pkg Use Append.dg Use cRDSDbView.pkg //Use DataDict.pkg Use cRDScImageList.pkg Use cRDSDbTabDialog.pkg Use cRDSDbTabPage.pkg Use cRDSDbForm.pkg Use cRDSDbCheckBox.pkg Use cRDSDbGroup.pkg Use cDbComboformFormat.pkg Use cDbComboformServer.pkg Use cRDSDbRadioGroup.pkg Use cRDSRadio.pkg Use cRDSTextbox.pkg Use cFileDSNButton.pkg Use cODBCAdminButton.pkg Use cDbComboFormDatabase.pkg Use cDbCheckBoxNtAuth.pkg Use cDbFormUser.pkg Use cDbFormPassword.pkg Use cDbFormSchema.pkg Use cLoginButton.pkg Use cDbFormPath.pkg Use cPathButton.pkg Use cDbComboformDataTable.pkg Use cViewDataButton.pkg Use cRDSForm.pkg Use cBitmapButton.pkg Use cDbComboformDriver.pkg Use cRDSDbComboForm.pkg Use cRDSGrid.pkg Use cDbFieldComboform.pkg Use cParentFieldsTreeView.pkg Use cChildFieldsTreeView.pkg Use cDbIndexComboform.pkg Use cRDSTreeView.pkg Use cRDSComboForm.pkg Use cRDSList.pkg Use cRDSGroup.pkg Use cRDSDbGrid.pkg Use cRDSContainer3d.pkg Use cRDSDbEdit.pkg Use cSyncTableCheckBoxGrid.pkg Use cSysDbCheckBox.pkg Use cRDSDbList.pkg Use cZeroLogBn.pkg Use SNCSYS.DD Use SNCTABLE.DD Use SNCSCHEM.DD Use SNCLOG.DD Use SNCTHEA.DD Use SNCTROW.DD ACTIVATE_VIEW Activate_oRdcView FOR oRdcView Object oRdcView is a cRDSDbView //Use LFFile.pkg // *** License check package *** Property Handle phoDD 0 Property Handle phoSnctable_Recid 0 Set Border_Style to Border_None Set Caption_Bar to FALSE Set Minimize_Icon to FALSE Set Maximize_Icon to TRUE Set Help_Id to GeneralHelpId Set Label to "CrossMerge Builder" Set Location to 0 0 Set Size to 369 558 Set piMinSize to 369 558 Set Auto_Clear_DEO_State to FALSE //AB-DDOStart Object Sncsys_DD is a Sncsys_DataDictionary End_Object // Sncsys_DD Object Snctable_DD is a SncTable_DataDictionary //AB-StoreTopStart //Define MODE_WAITING for 0 //wait-mode //Define MODE_FINDING For 1 //find-mode //Define MODE_CLEARING For 2 //clear-mode //Define MODE_CREATING For 3 //create-mode //Define MODE_SAVING For 4 //save-mode //Define MODE_DELETING For 5 //delete-mode //Define MODE_ABORTING For 6 //abort-mode //Define MODE_VALIDATING For 7 //request_validate-mode : added for VDF7 //Define MODE_CLEARINGALL For 8 //clear-all mode (added in VDF8) //AB-StoreTopEnd //AB-StoreStart Delegate Set phoDD To (Self) //Procedure DoCheckFindDataLoss // Integer bCancel bShould bRec iRetval // Get Current_Record To bRec // Get Should_Save To bShould // If (bRec <> 0 And bShould) Begin // Get IsNonIndexedFieldChanged (Main_File(Self)) To bShould // *** More generic solution *** // If (Not(bShould)) Begin // Get Confirm "Find operation will lose existing changes. Press 'Yes' to save and continue finding new record." To bCancel // If (Not(bCancel)) Send Request_Save_No_Clear // End // End // If (iFind_Mode = Mode_Finding) Begin //End_Procedure // DoCheckFindDataLoss // Helper function used by the DoCheckFindDataLoss procedure (below) to avoid losing changes made // to an existing record when the find keys and/or a selection list is used to find a new record: //Function IsNonIndexedFieldChanged Integer iFile Returns Boolean // Integer iField iFields iCount // Boolean bChanged bIndexed bRetval // Get_Attribute DF_FILE_NUMBER_FIELDS Of iFile To iFields // Move 1 To iField // Start with the first field after Recnum. // For iCount From 1 To iFields // Get_Attribute DF_FIELD_INDEX Of iFile iField To bIndexed // If Not bIndexed Get File_Field_Changed_State iFile iField To bChanged // If bChanged Break // Increment iField // Loop // If bChanged Move (True) To bRetval // Function_Return bRetval //End_Function // IsNonIndexedFieldChanged //**These procedures will prevent an operator from making a change and not saving then // finding a new record. Note: It triggers only if a _non_-index field has been changed. //Procedure Item_Find Integer iFind_Mode Integer iFile Integer iField Boolean bEntry_Update Boolean breport_errors Boolean bDeferred_State // Integer bCancel bShould bRec // Send DoCheckFindDataLoss // Forward Send Item_Find iFind_Mode iFile iField bEntry_Update bReport_Errors bDeferred_State //End_Procedure // Item_Find // This is the same as the Item_Find procedure above, but is used by selection list objects: //Procedure Find_By_Recnum Integer iFile Integer iRecord // Send DoCheckFindDataLoss // Forward Send Find_By_Recnum iFile iRecord //End_Procedure // Find_By_Recnum Procedure New_Current_Record Integer iOld Integer iNew Integer iState iFromFile iToFile Forward Send New_Current_Record iOld iNew If (Operation_Mode = Mode_Finding) Begin // showln "New_Current_Record" // This will be received by the cDbComboformFormat and cDbComboformServer classes. // and cDbComboformServer sends a message to cDbComboformDataTable to open // the tables and then update other DEO's: Broadcast Recursive Send DoFindData Of (Parent(Self)) End // If (iNew And Operation_Mode = Mode_Finding) Begin End_Procedure // New_Current_Record // Update toolbar buttons: Procedure Set Changed_State Integer iState Forward Set Changed_State To iState Send DoFlipToobarButtonState Of oToolbar iState Self End_Procedure // Set Changed_State Procedure Set Field_Changed_State Integer iField Boolean bState Handle hoDD Boolean bFromTableChanged bToTableChanged String sFromTo Forward Set Field_Changed_State To iField bState Move (SncTHea_DD(Self)) To hoDD // If table has been changed for an existing record and SncTHea (and rows) exist, // warn user that the Value Transformation tables are not valid any longer: If (Current_Record(Self) And Current_Record(hoDD)) Begin Get Field_Changed_State Field SncTable.FromDataTable To bFromTableChanged Get Field_Changed_State Field SncTable.ToDataTable To bToTableChanged If (bFromTableChanged Or bToTableChanged) Begin If (bFromTableChanged And Not(bToTableChanged)) Move "Source" To sFromTo Else If (Not(bFromTableChanged) And bToTableChanged) Move "Destination" To sFromTo Else If (bFromTableChanged And bToTableChanged) Move "Source and Destination" To sFromTo Send Info_Box ("WARNING! The Table Name has been changed for the" * sFromTo * "database(s) and Value Conversion table(s) exists for the old Table Name. You need to delete them on the 'Value Conversion' tab page.") End // If (bFromTableChanged Or bToTableChanged) Begin End // If (Current_Record(Self) And Current_Record(hoDD)) Begin End_Procedure // Set Field_Changed_State Procedure Clear Integer iFile iOpen Forward Send Clear Move 10 To iFile // From File Get_Attribute DF_FILE_OPENED Of iFile To iOpen If iOpen Close iFile Move 20 To iFile // To File Get_Attribute DF_FILE_OPENED Of iFile To iOpen If iOpen Close iFile Move 100 To iFile // From DDF File Get_Attribute DF_FILE_OPENED Of iFile To iOpen If iOpen Close iFile Move 110 To iFile // To DDF File Get_Attribute DF_FILE_OPENED Of iFile To iOpen If iOpen Close iFile Broadcast Recursive Send DoCheckClear Of (Parent(Self)) // Must be after Recursive Send DoCheckClear... Set Changed_State To False End_Procedure // Clear Procedure Clear_All Forward Send Clear_All Send Clear End_Procedure // Clear_All Procedure Request_Save Integer iRetval iFormat String sValue Get Field_Current_Value Field SncTable.ToIdxSelCount To iRetval If Not iRetval Begin Get YesNo_Box "Warning. You have not specified any index fields on the 'Index/Sorting' tab page. This will probably lead to an unsuccessful connection. Would you like to adjust before saving?" ; To iRetval If (iRetval = MBR_Yes) Procedure_Return End // If Not iRetval Begin Get Field_Current_Value Field SncTable.ToDefaults To sValue Get Field_Current_Value Field SncTable.ToDbType To iFormat Move (Trim(sValue)) To sValue If (iFormat <> 1 And iFormat <> 6 And Not(Length(sValue))) Begin // 1=DataFlex, 6=P.SQL Get YesNo_Box "Warning. You have not specified any null defaults on the 'Null Defaults' tab page. This will probably lead to an unsuccessful connection. Would you like to adjust before saving?" ; To iRetval If (iRetval = MBR_Yes) Procedure_Return End // If (sDriver <> FLEX_DRV_ID And sDriver <> DFBTRDRV_ID) Begin Forward Send Request_Save End_Procedure // Request_Save //AB-StoreEnd End_Object // Snctable_DD Object Sncschem_DD is a Sncschem_DataDictionary //AB-StoreStart //AB-StoreEnd End_Object // Sncschem_DD Object Snclog_DD is a Snclog_DataDictionary End_Object // Snclog_DD Object Sncthea_DD is a Sncthea_DataDictionary //AB-StoreTopStart Set Auto_Fill_State To True Set Ordering To 1 // TEST THIS! //Set Allow_Foreign_New_Save_State To True //AB-StoreTopEnd Set DDO_Server to Snctable_DD Set Constrain_File to Snctable.File_Number //AB-StoreStart Procedure Request_Save Integer iSncTable_Recid iRecid Get File_Field_Current_Value File_Field SncTable.Recid To iRecid If Not (Current_Record(Self)) ; Set Field_Changed_Value Field SncTHea.SncTable_Recid To iRecid Forward Send Request_Save End_Procedure // Request_Save Procedure DoCreateNewRecord // Initialize new SncTHea record. Integer iRecid Get File_Field_Current_Value File_Field SncTable.Recid To iRecid Send Clear Set Field_Changed_Value Field SncTHea.SncTable_Recid To iRecid End_Procedure // DoCreateNewRecord // Send from field value transformation table: Procedure DoFindRecord Integer iMode Integer iRecnum iOrdering Move SncTHea.Recnum To iRecnum Get Ordering To iOrdering Constraint_Set Self Constrain SncTHea Relates To SncTable If (iMode >= 0) Constrained_Find iMode SncTHea.File_Number by iOrdering Else If (iMode = -1) Constrained_Find First SncTHea.File_Number by iOrdering Else If (iMode = -2) Constrained_Find Last SncTHea.File_Number by iOrdering If (Found) Send Find_By_Recnum SncTHea.File_Number SncTHea.Recnum Else Begin // Reset record buffer. Clear SncTHea Move iRecnum To SncTHea.Recnum Find Eq SncTHea by Recnum End // Else Begin End_Procedure // DoFindRecord //AB-StoreEnd End_Object // Sncthea_DD Object Snctrow_DD is a Snctrow_DataDictionary //AB-StoreTopStart //Set Auto_Fill_State To True //AB-StoreTopEnd Set DDO_Server to Sncthea_DD Set Constrain_File to Sncthea.File_Number //AB-StoreStart //AB-StoreEnd End_Object // Snctrow_DD Set Main_DD to Snctable_DD Set Server to Snctable_DD //AB-DDOEnd Object oImage_lst is a cRDScImageList //AB/ Set Location to 0 528 Set piMaxImages to 11 //AB-StoreStart Procedure OnCreate Integer iIndex // Top tab-pages Get AddTransparentImage "File16.bmp" clFuchsia To iIndex Get AddTransparentImage "Collection16.bmp" clFuchsia To iIndex Get AddTransparentImage "CmEngine16.bmp" clFuchsia To iIndex Get AddTransparentImage "Log16.bmp" clFuchsia To iIndex // Tables Setup tab-pages: Get AddTransparentImage "Tables16.bmp" clFuchsia To iIndex Get AddTransparentImage "FindSmall.bmp" clFuchsia To iIndex // For prompt button on a dbform. Get AddTransparentImage "Fields16.bmp" clFuchsia To iIndex Get AddTransparentImage "Index16.bmp" clFuchsia To iIndex Get AddTransparentImage "Constrain16.bmp" clFuchsia To iIndex Get AddTransparentImage "Nulls16.bmp" clFuchsia To iIndex Get AddTransparentImage "ValTran16.bmp" clFuchsia To iIndex Get AddTransparentImage "Flags16.bmp" clFuchsia To iIndex Get AddTransparentImage "Other16.bmp" clFuchsia To iIndex Get AddTransparentImage "Info.bmp" clFuchsia To iIndex Get AddTransparentImage "Warning.bmp" clFuchsia To iIndex Get AddTransparentImage "Error.bmp" clFuchsia To iIndex End_Procedure // OnCreate //AB-StoreEnd End_Object // oImage_lst Object oRDS_td is a cRDSDbTabDialog Set Size to 365 558 Set Location to 4 0 Set Rotate_Mode to RM_Rotate_in_Ring Set phoImageList to oImage_lst Set peAnchors to anAll Set Pointer_only_state to TRUE Set Auto_Clear_DEO_state to FALSE Object oTable_tp is a cRDSDbTabPage Set Label to "1. Database Connections" Set Tab_ToolTip_Value to "Create/Edit/Delete Connection records for Source and Destination Data Tables" Object oSnctable_Recid is a cRDSDbForm //AB-StoreTopStart Delegate Set phoSnctable_Recid To (Self) // Panel property. //AB-StoreTopEnd Entry_Item Snctable.Recid Set Label to "Id (Auto generated)" Set Size to 13 70 Set Location to 4 83 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Prompt_Button_Mode to pb_PromptOn //AB-StoreStart Set Form_Button_Bitmap 0 To 'FindSmall.bmp/T/3D' Procedure Entering Returns Integer Forward Send Entering Send DoFlipToobarPromptState Of oToolbar True End_Procedure Procedure Exiting Integer iTo Returns Integer Forward Send Exiting iTo Send DoFlipToobarPromptState Of oToolbar False End_Procedure //AB-StoreEnd End_Object // oSnctable_Recid Object oSnctable_Sortfield is a cRDSDbForm Entry_Item Snctable.Sortfield Set Label to "Sort Name" Set Size to 13 79 Set Location to 4 218 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Form_Button_Bitmap 0 To 'FindSmall.bmp/T/3D' Procedure Entering Returns Integer Forward Send Entering Send DoFlipToobarPromptState Of oToolbar True End_Procedure Procedure Exiting Integer iTo Returns Integer Forward Send Exiting iTo Send DoFlipToobarPromptState Of oToolbar False End_Procedure //AB-StoreEnd End_Object // oSnctable_Sortfield Object oSnctable_Hide is a cRDSDbCheckBox Entry_Item Snctable.Hide Set Label to "Hide record" Set Size to 13 50 Set Location to 4 304 End_Object // oSnctable_Hide Object oSnctable_Datetime is a cRDSDbForm Entry_Item Snctable.Datetime Set Label to "Record Created" Set Size to 13 72 Set Location to 4 425 Set peAnchors to anTopRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right End_Object // oSnctable_Datetime Object oSnctable_Createdby is a cRDSDbForm Entry_Item Snctable.Createdby Set Label to "By" Set Size to 13 39 Set Location to 4 511 Set peAnchors to anTopRight Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Right End_Object // oSnctable_Createdby Object oSnctable_Text is a cRDSDbForm Entry_Item Snctable.Text Set Label to "Name" Set Size to 13 287 Set Location to 18 83 Set peAnchors to anTopLeftRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right End_Object // oSnctable_Text Object oSnctable_Lastedited is a cRDSDbForm Entry_Item Snctable.Lastedited Set Label to "Last Edited" Set Size to 13 72 Set Location to 18 425 Set peAnchors to anTopRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right End_Object // oSnctable_Lastedited Object oSnctable_Editedby is a cRDSDbForm Entry_Item Snctable.Editedby Set Label to "By" Set Size to 13 39 Set Location to 18 511 Set peAnchors to anTopRight Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Right End_Object // oSnctable_Editedby Object oDbTables_TD is a cRDSDbTabDialog Set Size to 315 551 Set Location to 34 0 Set TabWidth_Mode to twRightJustify Set Rotate_Mode to RM_Rotate Set phoImageList to oImage_lst Set peAnchors to anAll Set Auto_Clear_DEO_state to FALSE Object oDbTabPage1 is a cRDSDbTabPage Set Label to "Database Tables" Set Tab_ToolTip_Value to "Source and target database table details" Set piImageIndex to 4 Object oFromDatabase_grp is a cRDSDbGroup Set Size to 149 540 Set Location to 1 3 Set peAnchors to anTopLeftRight Set Label to "Source Database" Object oSnctable_Fromdbtype is a cDbComboformFormat Entry_Item Snctable.Fromdbtype Set Label to "Database Format" Set Size to 13 150 Set Location to 10 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to FALSE Set pbFrom to TRUE //AB-StoreStart //Set Enabled_State To True //AB-StoreEnd End_Object // oSnctable_Fromdbtype Object oSnctable_Fromserver is a cDbComboformServer Entry_Item Snctable.Fromserver Set Label to "Server" Set Size to 13 150 Set Location to 25 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to TRUE Set pbFrom to TRUE End_Object // oSnctable_Fromserver Object oFromDSN_grp is a cRDSDbRadioGroup //AB-StoreTopStart Property Handle phoServerObject (oSnctable_FromServer(Self)) Property Handle phoFileDSN_bn 0 // Set by the object itself. Property Integer piDbType 0 Property Boolean pbFrom True Property String psRadio1 ; ("An ODBC User data source stores information about how to connect to" * ; "the indicated data provider. A User data source is only visible to you," * ; "and can only be used on the current machine.") Property String psRadio2 ; ("An ODBC System data source stores information about how to connect to" * ; "the indicated data provider. A System data source is visible to all users" * ; "on this machine, including NT services.") Property String psRadio3 ; ("An ODBC File data source allows you to connect to a data provider. File" * ; "DSNs can be shared by users who have the same drivers installed." * ; "Note: Press the 'Select File' button below to select the file.") //AB-StoreTopEnd Entry_Item Snctable.Fromdsntype Set Size to 66 244 Set Location to 7 290 Set peAnchors to anTopRight Set Label to "Select the ODBC Data Source Type" Object oFromRadio1 is a cRDSRadio Set Label to "User Data Sources" Set Size to 10 74 Set Location to 10 5 //AB-StoreStart Set Status_Help To (psRadio1(Self)) Function Next_Object_Id Boolean bState Returns Integer Handle ho Move (oFromRadio2(Self)) To ho Function_Return ho End_Function // Next_Object_Id Function Prior_Object_Id Boolean bState Returns Integer Handle ho Move (oSnctable_FromServer(Self)) To ho Function_Return ho End_Function // Prior_Object_Id On_Key kNext_Item Send Switch On_Key kPrevious_Item Send Switch_Back On_Key Key_Tab Send Switch On_Key Key_Shift+Key_Tab Send Switch_Back //AB-StoreEnd End_Object // oFromRadio1 Object oFromRadio2 is a cRDSRadio Set Label to "System Data Sources" Set Size to 10 82 Set Location to 10 83 //AB-StoreStart Set Status_Help To (psRadio2(Self)) Function Next_Object_Id Boolean bState Returns Integer Handle ho Move (oFromRadio3(Self)) To ho Function_Return ho End_Function // Next_Object_Id Function Prior_Object_Id Boolean bState Returns Integer Handle ho Move (oFromRadio1(Self)) To ho Function_Return ho End_Function // Prior_Object_Id On_Key kNext_Item Send Switch On_Key kPrevious_Item Send Switch_Back On_Key Key_Tab Send Switch On_Key Key_Shift+Key_Tab Send Switch_Back //AB-StoreEnd End_Object // oFromRadio2 Object oFromRadio3 is a cRDSRadio Set Label to "File Data Sources" Set Size to 10 69 Set Location to 10 170 //AB-StoreStart Set Status_Help To (psRadio3(Self)) Function Prior_Object_Id Boolean bState Returns Integer Handle ho Move (oFromRadio2(Self)) To ho Function_Return ho End_Function // Prior_Object_Id On_Key kNext_Item Send Switch On_Key kPrevious_Item Send Switch_Back On_Key Key_Tab Send Switch On_Key Key_Shift+Key_Tab Send Switch_Back //AB-StoreEnd End_Object // oFromRadio3 Object oFromODBCText is a cRDSTextbox Set Label to "An ODBC File data source allows you to connect to a data provider. File DSNs can be shared by users who have the same drivers installed. Note: You can now press the 'Select File' button." Set Auto_Size_State to FALSE Set Location to 22 7 Set Size to 26 233 Set Justification_Mode to jMode_Left Set TypeFace to "MS Sans Serif" //AB-StoreStart Set Label_Shadow_Display_Mode To TBSHADOW_ON_ALL //AB-StoreEnd End_Object // oFromODBCText Object oFromFileDSN_bn is a cFileDSNButton //AB-StoreTopStart Set phoFileDSN_bn Of (oFromDSN_grp(Self)) To Self // Group property. //AB-StoreTopEnd Set Label to "&Select File" Set Size to 14 60 Set Location to 49 108 Set Status_Help to "Button is only enabled when the 'File Data Sources' radio button has been selected." Set peAnchors to anTopRight Set Bitmap to "FolderO16.bmp" Set piTransparentColor to clFuchsia Set pbFrom to TRUE //AB-StoreStart On_Key kRightArrow Send Switch On_Key kLeftArrow Send Switch_Back //AB-StoreEnd End_Object // oFromFileDSN_bn Object oFromODBCAdmin_bn is a cODBCAdminButton Set Label to "&ODBC Admin" Set Size to 14 70 Set Location to 49 170 Set Status_Help to "Start Windows 'ODBC Data Source Administrator' to create/edit ODBC data sources." Set peAnchors to anTopRight Set Bitmap to "ODBC16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Function Next_Object_Id Boolean bState Returns Integer Handle ho Move (oSncTable_FromUser(Self)) To ho Function_Return ho End_Function // Next_Object_Id On_Key kRightArrow Send Switch On_Key kLeftArrow Send Switch_Back //AB-StoreEnd End_Object // oFromODBCAdmin_bn //AB-StoreStart Procedure DoEnableDisable Integer iValue Set piDbType To iValue Set Enabled_State To (iValue = 4) Set Enabled_State Of (oFromFileDSN_bn(Self)) To (iValue = 4) // Set Enabled_State Of (oFromODBCAdmin_bn(Self)) To (iValue = 4) Set Current_Radio To 0 End_Procedure // DoEnableDisable // This shouldn't be needed but something is broken in VDF8: //Procedure DoFindData // Integer iFile iField iType // Handle hoDD // Get Data_File To iFile // Get Data_Field To iField // Get Server To hoDD // Get File_Field_Current_Value Of hoDD iFile iField To iType // Set Current_Radio To iType //End_Procedure // DoFindData Procedure Notify_Select_State Integer iToItem Integer iFromItem Handle ho Integer iFile iField Forward Send Notify_Select_State iToItem iFromItem Get Data_File To iFile Get Data_Field To iField Set File_Field_Changed_Value Of (Server(Self)) iFile iField To iToItem // If Not (Enabled_State(oFromODBCAdmin_bn(Self))) Begin // Set Value Of ho Item 0 To "" // Procedure_Return // End // If (ho And Shadow_State(oFromRadio1(Self))) Begin Move (oFromODBCText(Self)) To ho If (iToItem = 0) Set Value Of ho Item 0 To (psRadio1(Self)) If (iToItem = 1) Set Value Of ho Item 0 To (psRadio2(Self)) If (iToItem = 2) Set Value Of ho Item 0 To (psRadio3(Self)) If (phoFileDSN_bn(Self)) Set Enabled_State Of (phoFileDSN_bn(Self)) To (iToItem = 2) If (iToItem <> 2) Begin If (pbFrom(Self)) Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.FromFilePath To "" Else Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.ToFilePath To "" End // If (iToItem <> 2) Begin If (iToItem <> iFromItem And iToItem <> 2) Send DoEnableDisable Of (phoServerObject(Self)) (piDbType(Self)) End_Procedure // Notify_Select_State On_Key Key_Alt+Key_S Send KeyAction Of oFromFileDSN_bn On_Key Key_Alt+Key_O Send KeyAction Of oFromODBCAdmin_bn //AB-StoreEnd End_Object // oFromDSN_grp Object oSnctable_Fromdatabase is a cDbComboFormDatabase Entry_Item Snctable.Fromdatabase Set Label to "Database Name" Set Size to 13 150 Set Location to 40 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to TRUE Set pbFrom to TRUE End_Object // oSnctable_Fromdatabase Object oSnctable_Fromntauth is a cDbCheckBoxNtAuth Entry_Item Snctable.Fromntauth Set Label to "Use Windows NT Authentication" Set Size to 13 120 Set Location to 56 78 //AB-StoreStart //AB-StoreEnd End_Object // oSnctable_Fromntauth Object oSnctable_Fromuser is a cDbFormUser Entry_Item Snctable.Fromuser Set Label to "User Name" Set Size to 13 150 Set Location to 70 78 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set pbFrom to TRUE End_Object // oSnctable_Fromuser Object oSnctable_Frompv is a cDbFormPassword Entry_Item Snctable.Frompv Set Label to "Password" Set Size to 13 150 Set Location to 85 78 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right End_Object // oSnctable_Frompv Object oSnctable_Fromowner is a cDbFormSchema Entry_Item Snctable.Fromowner Set Label to "Schema Name" Set Size to 13 150 Set Location to 100 78 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set pbFrom to TRUE End_Object // oSnctable_Fromowner Object oFromLogin_bn is a cLoginButton Set Label to "&Login" Set Size to 14 60 Set Location to 100 230 Set Status_Help to "Click to login to the selected database server/data source." Set Bitmap to "Keys16.bmp" Set Enabled_State to FALSE Set piTransparentColor to clFuchsia Set pbFrom to TRUE Set phoViewButton to (oViewFromData_bn(Self)) //AB-StoreStart //Procedure OnClick // Send DoServerConnect //End_Procedure // OnClick //AB-StoreEnd End_Object // oFromLogin_bn Object oSnctable_Fromfilepath is a cDbFormPath Entry_Item Snctable.Fromfilepath Set Label to "Table Path" Set Size to 13 378 Set Location to 116 78 Set peAnchors to anTopLeftRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set pbFrom to TRUE End_Object // oSnctable_Fromfilepath Object oFromPath_bn is a cPathButton Set Label to "&Select File" Set Size to 14 60 Set Location to 116 458 Set Status_Help to "Click to activate the Open File Dialog and select a database table. Only available for database format 'DataFlex' and 'Pervasive'" Set peAnchors to anTopRight Set Bitmap to "FolderO16.bmp" Set piTransparentColor to clWhite Set pbFrom to TRUE //AB-StoreStart Procedure OnClick Send DoOpenFileDialog End_Procedure // OnClick //AB-StoreEnd End_Object // oFromPath_bn Object oSnctable_FromDataTable is a cDbComboformDataTable Entry_Item Snctable.Fromdatatable Set Label to "Table Name" Set Size to 13 150 Set Location to 132 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to TRUE Set pbFrom to TRUE //AB-StoreStart Function Prior_Object_Id Returns Integer Handle ho Forward Get Prior_Object_Id 0 To ho If (ho = 0) Move (oSnctable_Fromdbtype(Self)) To ho Function_Return ho End_Function // Prior_Object_Id //AB-StoreEnd End_Object // oSnctable_FromDataTable Object oViewFromData_bn is a cViewDataButton Set Label to "&View Data" Set Size to 14 60 Set Location to 132 230 Set Status_Help to "View data for the Source database table." Set Bitmap to "ViewData16.bmp" Set Enabled_State to FALSE Set piTransparentColor to clFuchsia Set pbFrom to TRUE //AB-StoreStart Procedure OnClick Send DoViewData True -1 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewFromData_bn Object oSnctable_Frfileoemtoansi is a cRDSDbCheckBox Entry_Item Snctable.Frfileoemtoansi Set Label to "Data saved in ANSI format" Set Size to 10 97 Set Location to 134 293 //AB-StoreStart Procedure DoEnableDisable Integer iValue If (Not(Current_Record(Main_DD(Self))) And iValue > 1 And iValue < 6) ; Set Checked_State To True End_Procedure // DoEnableDisable // We _must_ have this, else the program will hang while trying // to figure out the next_object_id with the cBitmap objects: //Function Next_Object_Id Returns Integer // Handle ho // Move (oSnctable_Todbtype(oToDatabase_grp(Self))) To ho // Function_Return ho //End_Function // Next_Object_Id //AB-StoreEnd End_Object // oSnctable_Frfileoemtoansi Object oNoOfFromRecords_fm is a cRDSForm Set Label to "Number of Records" Set Size to 13 60 Set Location to 132 458 Set Status_Help to "Current number of physical records for the selected database table. For other formats then DataFlex and Pervasive you need to press the Refresh button to the right." Set peAnchors to anTopRight Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Right Set Form_DataType to mask_numeric_window //AB-StoreStart //Set Form_Datatype item 0 To Mask_Numeric_Window Set Form_Mask Item 0 To "#,###########" Set Enabled_State To False //AB-StoreEnd End_Object // oNoOfFromRecords_fm Object oFromRecordRefresh_bn is a cBitmapButton Set Size to 14 16 Set Location to 132 520 Set Status_Help to "Refresh the number of records. (Alt+R)" Set peAnchors to anTopRight Set Bitmap to "Refresh16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Integer iOpen iRecords String sDriver If iFromFile Get_Attribute DF_FILE_OPENED Of iFromFile To iOpen Set Enabled_State To iOpen If iOpen Begin Get_Attribute DF_FILE_DRIVER Of iFromFile To sDriver If (sDriver = FLEX_DRV_ID Or sDriver = DFBTRDRV_ID) ; Get_Attribute DF_FILE_RECORDS_USED Of iFromFile To iRecords End // If iOpen Begin Set Value Of oNoOfFromRecords_fm To iRecords End_Procedure // DoUpdateData Procedure OnClick Integer iFile iOpen iRecords Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromFile To iFile If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen If iOpen Get_Attribute DF_FILE_RECORDS_USED Of iFile To iRecords Set Value Of oNoOfFromRecords_fm To iRecords End_Procedure // OnClick //AB-StoreEnd End_Object // oFromRecordRefresh_bn Object oSnctable_Fromdriver is a cDbComboformDriver Entry_Item Snctable.Fromdriver Set Label to "Database Driver" Set Size to 13 78 Set Location to 100 456 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to FALSE //AB-StoreStart Set pbHidden To True //AB-StoreEnd End_Object // oSnctable_Fromdriver //AB-StoreStart //Use LFFile.pkg // *** License check package *** On_Key Key_Alt+Key_R Send KeyAction Of oFromRecordRefresh_bn //AB-StoreEnd End_Object // oFromDatabase_grp Object oToDatabase_grp is a cRDSDbGroup Set Size to 149 540 Set Location to 150 3 Set peAnchors to anAll Set Label to "Target Database" Object oSnctable_Todbtype is a cDbComboformFormat Entry_Item Snctable.Todbtype Set Label to "Database Format" Set Size to 13 150 Set Location to 10 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to FALSE Set pbFrom to FALSE //AB-StoreStart // We need this to return to the correct object if Shift+Tab // is pressed. Function Prior_Object_Id Returns Integer Handle ho Move (oSnctable_Frfileoemtoansi(oFromDatabase_grp(Self))) To ho Function_Return ho End_Function // Prior_Object_Id //AB-StoreEnd End_Object // oSnctable_Todbtype Object oSnctable_Toserver is a cDbComboformServer Entry_Item Snctable.Toserver Set Label to "Server" Set Size to 13 150 Set Location to 25 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to TRUE Set pbFrom to FALSE End_Object // oSnctable_Toserver Object oToDSN_grp is a cRDSDbRadioGroup //AB-StoreTopStart Property Handle phoServerObject (oSnctable_ToServer(Self)) Property Handle phoFileDSN_bn 0 // Set by object itself. Property Integer piDbType 0 Property Boolean pbFrom False Property String psRadio1 ; ("An ODBC User data source stores information about how to connect to" * ; "the indicated data provider. A User data source is only visible to you," * ; "and can only be used on the current machine.") Property String psRadio2 ; ("An ODBC System data source stores information about how to connect to" * ; "the indicated data provider. A System data source is visible to all users" * ; "on this machine, including NT services.") Property String psRadio3 ; ("An ODBC File data source allows you to connect to a data provider. File" * ; "DSNs can be shared by users who have the same drivers installed." * ; "Note:Press the 'Select File' button below to select the file.") //AB-StoreTopEnd Entry_Item Snctable.Todsntype Set Size to 66 244 Set Location to 7 290 Set peAnchors to anTopRight Set Label to "Select the ODBC Data Source Type" Object oToRadio1 is a cRDSRadio Set Label to "User Data Sources" Set Size to 10 77 Set Location to 10 5 //AB-StoreStart Set Status_Help To (psRadio1(Self)) Function Next_Object_Id Boolean bState Returns Integer Handle ho Move (oToRadio2(Self)) To ho Function_Return ho End_Function // Next_Object_Id Function Prior_Object_Id Boolean bState Returns Integer Handle ho Move (oSnctable_ToServer(Self)) To ho Function_Return ho End_Function // Prior_Object_Id On_Key kNext_Item Send Next_Item On_Key kPrevious_Item Send Previous_Item //AB-StoreEnd End_Object // oToRadio1 Object oToRadio2 is a cRDSRadio Set Label to "System Data Sources" Set Size to 10 85 Set Location to 10 83 //AB-StoreStart Set Status_Help To (psRadio2(Self)) Function Next_Object_Id Boolean bState Returns Integer Handle ho Move (oToRadio3(Self)) To ho Function_Return ho End_Function // Next_Object_Id Function Prior_Object_Id Boolean bState Returns Integer Handle ho Move (oToRadio1(Self)) To ho Function_Return ho End_Function // Prior_Object_Id On_Key kNext_Item Send Next_Item On_Key kPrevious_Item Send Previous_Item //AB-StoreEnd End_Object // oToRadio2 Object oToRadio3 is a cRDSRadio Set Label to "File Data Sources" Set Size to 10 73 Set Location to 10 170 //AB-StoreStart Set Status_Help To (psRadio3(Self)) Function Prior_Object_Id Boolean bState Returns Integer Handle ho Move (oToRadio2(Self)) To ho Function_Return ho End_Function // Prior_Object_Id On_Key kNext_Item Send Next_Item On_Key kPrevious_Item Send Previous_Item //AB-StoreEnd End_Object // oToRadio3 Object oToODBCText is a cRDSTextbox Set Label to "An ODBC File data source allows you to connect to a data provider. File DSNs can be shared by users who have the same drivers installed. Note: You can now press the 'Select File' button." Set Auto_Size_State to FALSE Set Location to 22 7 Set Size to 24 233 Set Justification_Mode to jMode_Left Set TypeFace to "MS Sans Serif" //AB-StoreStart Set Label_Shadow_Display_Mode To TBSHADOW_ON_ALL //AB-StoreEnd End_Object // oToODBCText Object oToFileDSN_bn is a cFileDSNButton //AB-StoreTopStart Set phoFileDSN_bn Of (oToDSN_grp(Self)) To Self // Group property. //AB-StoreTopEnd Set Label to "&Select File" Set Size to 14 60 Set Location to 49 108 Set Status_Help to "Button is only enabled when the 'File Data Sources' radio button has been selected." Set peAnchors to anTopRight Set Bitmap to "FolderO16.bmp" Set piTransparentColor to clFuchsia Set pbFrom to FALSE //AB-StoreStart On_Key kRightArrow Send Switch On_Key kLeftArrow Send Switch_Back //AB-StoreEnd End_Object // oToFileDSN_bn Object oToODBCAdmin_bn is a cODBCAdminButton Set Label to "&ODBC Admin" Set Size to 14 70 Set Location to 49 170 Set Status_Help to "Start Windows 'ODBC Data Source Administrator' to create/edit ODBC data sources." Set peAnchors to anTopRight Set Bitmap to "ODBC16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Function Next_Object_Id Boolean bState Returns Integer Handle ho Move (oSncTable_ToUser(Self)) To ho Function_Return ho End_Function // Next_Object_Id On_Key kRightArrow Send Switch On_Key kLeftArrow Send Switch_Back //AB-StoreEnd End_Object // oToODBCAdmin_bn //AB-StoreStart Procedure DoEnableDisable Integer iValue Set piDbType To iValue Set Enabled_State To (iValue = 4) Set Enabled_State Of (oToFileDSN_bn(Self)) To (iValue = 4) // Set Enabled_State Of (oToODBCAdmin_bn(Self)) To (iValue = 4) // Set Current_Radio To 1 Set Current_Radio To 0 End_Procedure // DoEnableDisable // This shouldn't be needed but something is broken in VDF8? //Procedure DoFindData // Integer iFile iField iType // Handle hoDD // Get Data_File To iFile // Get Data_Field To iField // Get Server To hoDD // Get File_Field_Current_Value Of hoDD iFile iField To iType // Set Current_Radio To iType //End_Procedure // DoFindData Procedure Notify_Select_State Integer iToItem Integer iFromItem Handle ho Integer iFile iField Forward Send Notify_Select_State iToItem iFromItem Get Data_File To iFile Get Data_Field To iField Set File_Field_Changed_Value Of (Server(Self)) iFile iField To iToItem Move (oToODBCText(Self)) To ho // If Not (Enabled_State(oToODBCAdmin_bn(Self))) Begin // //Set Value Of ho Item 0 To "" // Procedure_Return // End // If (ho And Not(Enabled_State(Self))) Begin If (iToItem = 0) Set Value Of ho Item 0 To (psRadio1(Self)) If (iToItem = 1) Set Value Of ho Item 0 To (psRadio2(Self)) If (iToItem = 2) Set Value Of ho Item 0 To (psRadio3(Self)) If (phoFileDSN_bn(Self)) Set Enabled_State Of (phoFileDSN_bn(Self)) To (iToItem = 2) If (iToItem <> 2) Begin If (pbFrom(Self)) Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.FromFilePath To "" Else Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.ToFilePath To "" End // If (iToItem <> 2) Begin If (iToItem <> iFromItem And iToItem <> 2) Send DoEnableDisable Of (phoServerObject(Self)) (piDbType(Self)) End_Procedure // Notify_Select_State On_Key Key_Alt+Key_S Send KeyAction Of oFromFileDSN_bn On_Key Key_Alt+Key_O Send KeyAction Of oFromODBCAdmin_bn //AB-StoreEnd End_Object // oToDSN_grp Object oSnctable_Todatabase is a cDbComboFormDatabase Entry_Item Snctable.Todatabase Set Label to "Database Name" Set Size to 13 150 Set Location to 40 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to TRUE Set pbFrom to FALSE //AB-StoreStart Set Label_Shadow_Display_Mode To TBSHADOW_ON_NONE //AB-StoreEnd End_Object // oSnctable_Todatabase Object oSnctable_Tontauth is a cDbCheckBoxNtAuth Entry_Item Snctable.Tontauth Set Label to "Use Windows NT Authentication" Set Size to 13 120 Set Location to 56 78 Set pbFrom to FALSE End_Object // oSnctable_Tontauth Object oSnctable_Touser is a cDbFormUser Entry_Item Snctable.Touser Set Label to "User Name" Set Size to 13 150 Set Location to 70 78 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set pbFrom to FALSE End_Object // oSnctable_Touser Object oSnctable_Topv is a cDbFormPassword Entry_Item Snctable.Topv Set Label to "Password" Set Size to 13 150 Set Location to 85 78 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right End_Object // oSnctable_Topv Object oSnctable_Toowner is a cDbFormSchema Entry_Item Snctable.Toowner Set Label to "Schema Name" Set Size to 13 150 Set Location to 100 78 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set pbFrom to FALSE End_Object // oSnctable_Toowner Object oToLogin_bn is a cLoginButton Set Label to "L&ogin" Set Size to 14 60 Set Location to 100 230 Set Status_Help to "Click to login to the selected database server/data source. You only need to do this if you get a login error." Set Bitmap to "Keys16.bmp" Set Enabled_State to FALSE Set piTransparentColor to clFuchsia Set pbFrom to FALSE Set phoViewButton to (oViewToData_bn(Self)) //AB-StoreStart //Procedure OnClick // Send DoServerConnect //End_Procedure // OnClick //AB-StoreEnd End_Object // oToLogin_bn Object oSnctable_Tofilepath is a cDbFormPath Entry_Item Snctable.Tofilepath Set Label to "Table Path" Set Size to 13 379 Set Location to 116 78 Set peAnchors to anTopLeftRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set pbFrom to FALSE End_Object // oSnctable_Tofilepath Object oToPath_bn is a cPathButton Set Label to "Select &File" Set Size to 14 60 Set Location to 116 458 Set Status_Help to "Click to activate the Open File Dialog and select a database table. Only available for database format 'DataFlex' and 'Pervasive'" Set peAnchors to anTopRight Set Bitmap to "FolderO16.bmp" Set piTransparentColor to clFuchsia Set pbFrom to FALSE //AB-StoreStart Procedure OnClick Send DoOpenFileDialog End_Procedure // OnClick //AB-StoreEnd End_Object // oToPath_bn Object oSnctable_ToDataTable is a cDbComboformDataTable Entry_Item Snctable.Todatatable Set Label to "Table Name" Set Size to 13 150 Set Location to 132 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to TRUE Set pbFrom to FALSE //AB-StoreStart Function Prior_Object_Id Returns Integer Handle ho Forward Get Prior_Object_Id 0 To ho If (ho = 0) Move (oSnctable_Todbtype(Self)) To ho Function_Return ho End_Function // Prior_Object_Id //AB-StoreEnd End_Object // oSnctable_ToDataTable Object oViewToData_bn is a cViewDataButton Set Label to "View &Data" Set Size to 14 60 Set Location to 132 230 Set Status_Help to "View data for the Target database table." Set Bitmap to "ViewData16.bmp" Set Enabled_State to FALSE Set piTransparentColor to clFuchsia Set pbFrom to FALSE //AB-StoreStart Procedure OnClick Send DoViewData True -1 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewToData_bn Object oSnctable_Tofileoemtoansi is a cRDSDbCheckBox Entry_Item Snctable.Tofileoemtoansi Set Label to "Save data in ANSI format" Set Size to 10 95 Set Location to 134 293 //AB-StoreStart Procedure DoEnableDisable Integer iValue If (Not(Current_Record(Main_DD(Self))) And iValue > 1 And iValue < 6) ; Set Checked_State To True // If (iValue = 1) Set Enabled_State To False // Else Set Enabled_State To True End_Procedure // DoEnableDisable // We _must_ have this, else the program will hang while trying // to figure out the next_object_id with the cBitmap objects: //Function Next_Object_Id Returns Integer // Handle ho // Move (oDbTabPage2(oDbTables_TD(Self))) To ho // Function_Return ho //End_Function // Next_Object_Id //AB-StoreEnd End_Object // oSnctable_Tofileoemtoansi Object oNoOfToRecords_fm is a cRDSForm Set Label to "Number of Records" Set Size to 13 60 Set Location to 132 458 Set Status_Help to "Current number of physical records for the selected database table. For other formats then DataFlex and Pervasive you need to press the Refresh button to the right." Set peAnchors to anTopRight Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Right Set Form_DataType to mask_numeric_window //AB-StoreStart Set Form_Mask Item 0 To "#,###########" Set Enabled_State To False //AB-StoreEnd End_Object // oNoOfToRecords_fm Object oToRecordRefresh_bn is a cBitmapButton Set Size to 14 16 Set Location to 132 520 Set Status_Help to "Refresh the number of records. (Alt+R)" Set peAnchors to anTopRight Set Bitmap to "Refresh16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Integer iOpen iRecords String sDriver If iToFile Get_Attribute DF_FILE_OPENED Of iToFile To iOpen Set Enabled_State To iOpen If iOpen Begin Get_Attribute DF_FILE_DRIVER Of iToFile To sDriver If (sDriver = FLEX_DRV_ID Or sDriver = DFBTRDRV_ID) ; Get_Attribute DF_FILE_RECORDS_USED Of iToFile To iRecords End // If iOpen Begin Set Value Of oNoOfToRecords_fm To iRecords End_Procedure // DoUpdateData Procedure OnClick Integer iFile iOpen iRecords Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToFile To iFile If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen If iOpen Get_Attribute DF_FILE_RECORDS_USED Of iFile To iRecords Set Value Of oNoOfToRecords_fm To iRecords End_Procedure // OnClick //AB-StoreEnd End_Object // oToRecordRefresh_bn Object oSnctable_Todriver is a cDbComboformDriver Entry_Item Snctable.Todriver Set Label to "Database Driver" Set Size to 13 78 Set Location to 98 457 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to FALSE //AB-StoreStart Set pbHidden To True //AB-StoreEnd End_Object // oSnctable_Todriver //AB-StoreStart On_Key Key_Alt+Key_R Send KeyAction Of oToRecordRefresh_bn //AB-StoreEnd End_Object // oToDatabase_grp //AB-StoreStart On_Key Key_Alt+Key_S Send KeyAction Of oFromPath_bn On_Key Key_Alt+Key_L Send KeyAction Of oFromLogin_bn On_Key Key_Alt+Key_V Send KeyAction Of oViewFromData_bn On_Key Key_Alt+Key_F Send KeyAction Of oToPath_bn On_Key Key_Alt+Key_O Send KeyAction Of oToLogin_bn On_Key Key_Alt+Key_D Send KeyAction Of oViewToData_bn //AB-StoreEnd End_Object // oDbTabPage1 Object oDbTabPage2 is a cRDSDbTabPage Set Label to "Fields/Columns" Set Tab_ToolTip_Value to "Field selection method and fields to include for the two tables" Set piImageIndex to 5 Object oSnctable_Synchtype is a cRDSDbComboForm Entry_Item Snctable.Synchtype Set Label to "Field Selection Type" Set Size to 13 150 Set Location to 10 81 Set Form_Border to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State Item 0 to FALSE Set Code_Display_Mode to cb_code_display_both //AB-StoreStart Procedure OnChange Integer iType Forward Send OnChange Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.Synchtype To iType Broadcast Recursive Send DoEnableDisable Of (Parent(Self)) iType End_Procedure // OnChange //Set Label_Shadow_Display_Mode To TBSHADOW_ON_LOCAL //Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom // Forward Send DoUpdateData iFromFile iToFile bFrom // Send Enable_Window Of (Label_Object(Self)) (iFromFile And iToFile) //End_Procedure // DoUpdateData Function Next_Object_Id Boolean bState Returns Integer Handle ho Integer iType Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.Synchtype To iType If (iType = 1) Move (oFieldNames_grd(Self)) To ho If (iType = 2) Move (oFromStartField_cf(oFieldRange_grp(Self))) To ho If (iType = 3) Move (oFromParentFields_tv(oSelectedFields_grp(Self))) To ho Function_Return ho End_Function // Next_Object_Id //AB-StoreEnd End_Object // oSnctable_Synchtype Object oFromDataTable_fm is a cRDSDbForm Entry_Item Snctable.Fromdatatable Set Label to "Source Table" Set Size to 13 150 Set Location to 198 80 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //Set Label_Shadow_Display_Mode To TBSHADOW_ON_LOCAL Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Send Enable_Window Of (Label_Object(Self)) (iFromFile And iToFile) End_Procedure // DoUpdateData //AB-StoreEnd End_Object // oFromDataTable_fm Object oViewFromData_bn is a cViewDataButton Set Label to "&View Data" Set Size to 14 55 Set Location to 213 80 Set Status_Help to "View data for the Source database table." Set Bitmap to "ViewData16.bmp" Set Enabled_State to FALSE Set piTransparentColor to clFuchsia Set pbFrom to TRUE //AB-StoreStart Procedure OnClick Send DoViewData True -1 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewFromData_bn Object oToDataTable_fm is a cRDSDbForm Entry_Item Snctable.Todatatable Set Label to "Target Table" Set Size to 13 150 Set Location to 229 80 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //Set Label_Shadow_Display_Mode To TBSHADOW_ON_LOCAL Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Send Enable_Window Of (Label_Object(Self)) (iFromFile And iToFile) End_Procedure // DoUpdateData //AB-StoreEnd End_Object // oToDataTable_fm Object oViewToData_bn is a cViewDataButton Set Label to "View &Data" Set Size to 14 55 Set Location to 244 80 Set Status_Help to "View data for the Target database table." Set Bitmap to "ViewData16.bmp" Set Enabled_State to FALSE Set piTransparentColor to clFuchsia Set pbFrom to FALSE //AB-StoreStart Procedure OnClick Send DoViewData True -1 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewToData_bn Object oMatchingFields_grp is a cRDSDbGroup Set Size to 88 540 Set Location to 26 3 Set peAnchors to anLeftRight Set Label to "1 - Matching Field Names" Object oFieldNames_grd is a cRDSGrid //AB-StoreTopStart Property String psItemHelpText ; "Red color denotes that the field length and/or type is not the same for the Source and Target tables." //AB-StoreTopEnd Set Color to cl3dLight Set CurrentCellColor to clYellow Set CurrentCellTextColor to clWhite Set Size to 63 527 Set Location to 9 6 Set Autosize_height_state to TRUE Set peAnchors to anLeftRight Set peResizeColumn to rcAll Set GridLine_Mode to GRID_VISIBLE_VERT Set peDisabledColor to clNavy Set peDisabledTextColor to clWindowText Set Line_Width to 8 0 Set Form_Width item 0 to 35 Set Header_Label item 0 to "Number" Set Form_Width item 1 to 126 Set Header_Label item 1 to "Source Table Field Name" Set Form_Width item 2 to 60 Set Header_Label item 2 to "Field Type" Set Form_Width item 3 to 40 Set Header_Label item 3 to "Length" Set Form_Width item 4 to 35 Set Header_Label item 4 to "Number" Set Form_Width item 5 to 126 Set Header_Label item 5 to "Target Table Field Name" Set Form_Width item 6 to 60 Set Header_Label item 6 to "Field Type" Set Form_Width item 7 to 40 Set Header_Label item 7 to "Length" //AB-StoreStart Set Select_Mode To No_Select Set psToolTipTitle To "Matching Field Names" Set psToolTip To (psItemHelpText(Self)) //Set Status_Help Item 0 To (psItemHelpText(Self)) //Set Status_Help Item 1 To (psItemHelpText(Self)) //Set Status_Help Item 2 To (psItemHelpText(Self)) //Set Status_Help Item 3 To (psItemHelpText(Self)) //Set Status_Help Item 4 To (psItemHelpText(Self)) //Set Status_Help Item 5 To (psItemHelpText(Self)) //Set Status_Help Item 6 To (psItemHelpText(Self)) //Set Status_Help Item 7 To (psItemHelpText(Self)) Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Send DoFillGrid iFromFile iToFile End_Procedure // DoUpdateData Procedure DoFillGrid Integer iFromFile Integer iToFile Handle ho Integer iCount iFromFields iToField iFrField iStart Integer iFromLength iToLength iFromType iToType iFromPrec iToPrec iMatch Boolean bIsOpen String sFieldName sType sChar sRootName sFromDriver sToDriver Send Delete_Data // Delete old items. Set Value Of oNoOfMatchingNames_fm To "" Set Value Of oTotFields_fm To "" If (iFromFile = 0 Or iToFile = 0) Procedure_Return Send Ignore_Error Of Error_Info_Object 4100 // "Cannot find field". Used to not trigger error while trying to find a matching field name in ToFile. Send Ignore_Error Of Error_Info_Object 77 // "Field number out of range" Set Dynamic_Update_State To False Get_Attribute DF_FILE_OPENED Of iFromFile To bIsOpen If Not bIsOpen Procedure_Return Get_Attribute DF_FILE_OPENED Of iToFile To bIsOpen If Not bIsOpen Procedure_Return Get_Attribute DF_FILE_NUMBER_FIELDS Of iFromFile To iFromFields Get_Attribute DF_FILE_DRIVER Of iFromFile To sFromDriver Get_Attribute DF_FILE_DRIVER Of iToFile To sToDriver If (sFromDriver = FLEX_DRV_ID) Move 0 To iStart // Then start at Recnum. Else Move 1 To iStart For iCount From iStart To iFromFields Get_Attribute DF_FIELD_NUMBER Of iFromFile iCount To iFrField Get_Attribute DF_FIELD_TYPE Of iFromFile iFrField To iFromType If (iFromType <> DF_OVERLAP) Begin Get FieldType iFromType To sType // Function in SyncFuncs.pkg Get_Attribute DF_FIELD_NAME Of iFromFile iFrField To sFieldname Indicate Err False // Field_Map iToFile sFieldName To iToField Get FieldMap iToFile sFieldName To iToField Get UpperFirstChar sFieldName To sFieldName // Function in SyncFuncs.pkg If (iToField <> - 1) Begin // If Not (Err) Begin // iFromFile: Send Add_Item msg_None iFrField // Item "0" = iFromFile field number Send Add_Item msg_None sFieldName // Item "1" = iFromFile field name Send Add_Item msg_None sType // Item "2" = iFromFile field type Get_Attribute DF_FIELD_LENGTH Of iFromFile iFrField To iFromLength Get_Attribute DF_FIELD_PRECISION Of iFromFile iFrField To iFromPrec If (iFromType = DF_BCD) ; Move (iFromLength - iFromPrec) To iFromLength Else Move 0 To iFromPrec Send Add_Item msg_None (String(iFromLength) + "," + String(iFromPrec)) // Item "3" = iFromFile field length // iToFile: Send Add_Item msg_None iToField // Item "4" = iToFile field number Get_Attribute DF_FIELD_NAME Of iToFile iToField To sFieldname Get UpperFirstChar sFieldName To sFieldName // Function in SyncFuncs.pkg Send Add_Item msg_None sFieldName // Item "5" = iToFile field name Get_Attribute DF_FIELD_TYPE Of iToFile iToField To iToType Get FieldType iToType To sType // Function in SyncFuncs.pkg Send Add_Item msg_None sType // Item "6" = iToFile field type Get_Attribute DF_FIELD_LENGTH Of iToFile iToField To iToLength Get_Attribute DF_FIELD_PRECISION Of iToFile iToField To iToPrec If (iToType = DF_BCD) ; Move (iToLength - iToPrec) To iToLength Else Move 0 To iToPrec Send Add_Item msg_None (String(iToLength) + "," + String(iToPrec)) // Item "7" = iToFile field length If (iFromType <> iToType) Begin Set ItemColor Item (Item_Count(Self) -2) To clRed Set ItemColor Item (Item_Count(Self) -6) To clRed End // If (iFromType <> iToType) Begin If (iFromLength <> iToLength Or iFromPrec <> iToPrec) Begin Set ItemColor Item (Item_Count(Self) -1) To clRed Set ItemColor Item (Item_Count(Self) -5) To clRed End // If (iFromLength <> iToLength Or iFromPrec <> iToPrec) Begin End // If Not (Err) Begin End // If (iFromType <> DF_OVERLAP) Begin Loop Get Item_Count To iMatch For iCount From 0 To (iMatch -1) Set Entry_State Item iCount To False Loop Move (iMatch / 8) To iMatch Set Value Of oNoOfMatchingNames_fm To iMatch If (sFromDriver = FLEX_DRV_ID) Add 1 To iFromFields Set Value Of oTotFields_fm To iFromFields Send Trap_Error Of Error_Info_Object 4100 Send Trap_Error Of Error_Info_Object 77 Set Dynamic_Update_State To True End_Procedure // DoFillGrid Function FieldMap Integer iFile String sFieldName Returns String Integer iFields iField iStart String sTableFieldName sDriver Move (Uppercase(sFieldName)) To sFieldName Get_Attribute DF_FILE_DRIVER Of iFile To sDriver If (sDriver = FLEX_DRV_ID) Move 0 To iStart // Then start at Recnum. Else Move 1 To iStart Get_Attribute DF_FILE_NUMBER_FIELDS Of iFile To iFields For iField From iStart To iFields Get_Attribute DF_FIELD_NAME Of iFile iField To sTableFieldName If (Uppercase(sTableFieldName) = sFieldName) Function_Return iField Loop Indicate Err False Function_Return -1 End_Function // FieldMap Function Next_Object_Id Boolean bState Returns Integer Handle ho Move (oSnctable_Synchtype(Self)) To ho Function_Return ho End_Function // Next_Object_Id //AB-StoreEnd End_Object // oFieldNames_grd Object oNoOfMatchingNames_fm is a cRDSForm Set Label to "Matching Field Names" Set Size to 13 23 Set Location to 72 472 Set Status_Help to "Number of fields/columns with the same name" Set peAnchors to anBottomRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oNoOfMatchingNames_fm Object oTotFields_fm is a cRDSForm Set Label to "Of" Set Size to 13 23 Set Location to 72 511 Set Status_Help to "Total number of fields for the Source data table." Set peAnchors to anBottomRight Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oTotFields_fm //AB-StoreStart Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set Enabled_State To (iFromFile And iToFile) Set Enabled_State Of oSnctable_Synchtype To (iFromFile And iToFile) End_Procedure // DoUpdateData Procedure DoEnableDisable Integer iType Handle ho Integer iItems Move (oFieldNames_grd(Self)) To ho Get Item_Count Of ho To iItems Set Enabled_State To (iType = 1 And iItems) End_Procedure // DoEnableDisable Procedure Set Enabled_State Boolean bState Handle ho Move (oFieldNames_grd(Self)) To ho Forward Set Enabled_State To bState If bState Set Color Of ho To clWindow Else Set Color Of ho To cl3dLight Get Label_Object Of oNoOfMatchingNames_fm To ho Set Enabled_State Of ho To bState Get Label_Object Of oTotFields_fm To ho Set Enabled_State Of ho To bState End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oMatchingFields_grp Object oFieldRange_grp is a cRDSDbGroup Set Size to 75 234 Set Location to 118 3 Set peAnchors to anTopLeft Set Label to "2 - Range of Field Numbers" Object oFromStartField_cf is a cDbFieldComboform Entry_Item Snctable.Fromstartfield Set Label to "Source Start Field" Set Size to 13 150 Set Location to 22 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to FALSE Set Code_Display_Mode to cb_Code_Display_Description Set pbFrom to TRUE //AB-StoreStart //AB-StoreEnd End_Object // oFromStartField_cf Object oFromStopField_cf is a cDbFieldComboform Entry_Item Snctable.Fromstopfield Set Label to "Source Stop Field" Set Size to 13 150 Set Location to 37 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to FALSE Set Code_Display_Mode to cb_Code_Display_Description Set pbFrom to TRUE //AB-StoreStart //AB-StoreEnd End_Object // oFromStopField_cf Object oToStartField_cf is a cDbFieldComboform Entry_Item Snctable.Tostartfield Set Label to "Target Start Field" Set Size to 13 150 Set Location to 52 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to FALSE Set Code_Display_Mode to cb_Code_Display_Description Set pbFrom to FALSE //AB-StoreStart //Function Next_Object_Id Returns Integer // Handle ho // Move (oDbTabPage3(oDbTables_TD(Self))) To ho // Function_Return ho //End_Function // Next_Object_Id //AB-StoreEnd End_Object // oToStartField_cf //AB-StoreStart Procedure DoEnableDisable Integer iType Set Enabled_State To (iType = 2) End_Procedure // DoEnableDisable //AB-StoreEnd End_Object // oFieldRange_grp Object oSelectedFields_grp is a cRDSDbGroup Set Size to 181 301 Set Location to 118 242 Set peAnchors to anAll Set Label to "3 - Selected Field Numbers" Object oFromParentFields_tb is a cRDSTextbox Set Label to "Available Source Fields:" Set Location to 10 7 Set Size to 10 77 Set TypeFace to "MS Sans Serif" End_Object // oFromParentFields_tb Object oFromParentFields_tv is a cParentFieldsTreeView //AB-StoreTopStart Set pbFrom To True //AB-StoreTopEnd Set peAnchors to anTopLeftRight Set Size to 54 140 Set Location to 21 7 Set pbFullRowSelect to TRUE Set TreeButtonsState to FALSE Set TreeRetainSelState to TRUE Set Status_Help to "Double-click or press space-bar to select a Source field or the Ins key to insert a Source field" //AB-StoreStart Set psToolTipTitle To (Label(oFromParentFields_tb(Self))) Procedure DoEnableDisable Integer iType If (iType = 3) Begin Set piBackColor To clNone Set piTextColor To clNone End // If (iType = 3) Begin Else Begin Set piBackColor To clLtGray Set piTextColor To clGray End // Else Begin End_Procedure // DoEnableDisable Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set piFile To iFromFile End_Procedure // DoUpdateData //AB-StoreEnd End_Object // oFromParentFields_tv Object oToParentFields_tb is a cRDSTextbox Set Label to "Available Target Fields:" Set Location to 10 154 Set Size to 10 75 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oToParentFields_tb Object oToParentFields_tv is a cParentFieldsTreeView //AB-StoreTopStart Set pbFrom To False //AB-StoreTopEnd Set peAnchors to anTopRight Set Size to 54 140 Set Location to 21 154 Set pbFullRowSelect to TRUE Set TreeButtonsState to FALSE Set TreeRetainSelState to TRUE Set Status_Help to "Double-click or press space-bar to select a Target field or the Ins key to insert a Target field" //AB-StoreStart Set psToolTipTitle To (Label(oToParentFields_tb(Self))) Procedure DoEnableDisable Integer iType If (iType = 3) Begin Set piBackColor To clNone Set piTextColor To clNone End // If (iType = 3) Begin Else Begin Set piBackColor To clLtGray Set piTextColor To clGray End // Else Begin End_Procedure // DoEnableDisable Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set piFile To iToFile End_Procedure // DoUpdateData //AB-StoreEnd End_Object // oToParentFields_tv Object oFromChildFields_tb is a cRDSTextbox Set Label to "Selected Source Fields:" Set Location to 79 7 Set Size to 10 76 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopLeft End_Object // oFromChildFields_tb Object oFromChildFields_tv is a cChildFieldsTreeView Set peAnchors to anAll Set Size to 70 140 Set Location to 90 7 Set pbFullRowSelect to TRUE Set TreeButtonsState to FALSE Set TreeRetainSelState to TRUE Set phoParent to (oFromParentFields_tv(Self)) Set psFieldName to "SelFromFields" Set Status_Help to "Double-click or press the Del key to de-select a Source field." Set pbFrom to TRUE Set Server to (Main_DD(Self)) //AB-StoreStart Set psToolTipTitle To (Label(oFromChildFields_tb(Self))) Procedure DoEnableDisable Integer iType If (iType = 3) Begin Set piBackColor To clNone Set piTextColor To clNone End // If (iType = 3) Begin Else Begin Set piBackColor To clLtGray Set piTextColor To clGray End // Else Begin End_Procedure // DoEnableDisable Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set piFile To iFromFile Send OnCreateTree End_Procedure // DoUpdateData Procedure UpdateDDO Send DoUpdateDDBuffer (Main_DD(Self)) "SelFromFields" "SelFieldCount" // Class procedure. End_Procedure // UpdateDDO Procedure DoAddItem String sLabel Integer iData Integer iItems Forward Send DoAddItem sLabel iData Get ItemCount To iItems Set Value Of oSelFromCount_fm To iItems Set Enabled_State Of oAppend_bn To True Send UpdateDDO End_Procedure // DoAddItem Procedure DoInsertItem String sLabel Integer iData Integer iItems Forward Send DoInsertItem sLabel iData Get ItemCount To iItems Set Value Of oSelFromCount_fm To iItems Send UpdateDDO End_Procedure // DoInsertItem Procedure DoCutItem Integer iItems Forward Send DoCutItem Get ItemCount To iItems Set Value Of oSelFromCount_fm To iItems Send UpdateDDO End_Procedure // DoCutItem Procedure DoCreateTree Integer iItems Forward Send DoCreateTree Get ItemCount To iItems Set Value Of oSelFromCount_fm To iItems Set Enabled_State Of oAppend_bn To iItems End_Procedure // DoCreateTree Procedure OnItemChanged Handle hItem Handle hItemOld Integer iData iItem Get ItemNumber hItem To iItem // New class function. Send DoFindMatchingItem Of oToChildFields_tv iItem End_Procedure // OnItemChanged //AB-StoreEnd End_Object // oFromChildFields_tv Object oToChildFields_tb is a cRDSTextbox Set Label to "Selected Target Fields:" Set Location to 80 154 Set Size to 10 74 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oToChildFields_tb Object oToChildFields_tv is a cChildFieldsTreeView Set peAnchors to anTopBottomRight Set Size to 70 140 Set Location to 91 154 Set pbFullRowSelect to TRUE Set TreeButtonsState to FALSE Set TreeRetainSelState to TRUE Set phoParent to (oToParentFields_tv(Self)) Set psFieldName to "SelToFields" Set Status_Help to "Double-click or press the Del key to de-select a Target field." Set pbFrom to FALSE Set Server to (Main_DD(Self)) //AB-StoreStart Set psToolTipTitle To (Label(oToChildFields_tb(Self))) Procedure DoEnableDisable Integer iType If (iType = 3) Begin Set piBackColor To clNone Set piTextColor To clNone End // If (iType = 3) Begin Else Begin Set piBackColor To clLtGray Set piTextColor To clGray End // Else Begin End_Procedure // DoEnableDisable Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set piFile To iToFile Send OnCreateTree End_Procedure // DoUpdateData Procedure UpdateDDO Send DoUpdateDDBuffer (Main_DD(Self)) "SelToFields" "" // Class procedure. End_Procedure // UpdateDDO Procedure DoAddItem String sLabel Integer iData Integer iItems Forward Send DoAddItem sLabel iData Get ItemCount To iItems Set Value Of oSelToCount_fm To iItems Send UpdateDDO End_Procedure // DoAddItem Procedure DoInsertItem String sLabel Integer iData Integer iItems Forward Send DoInsertItem sLabel iData Get ItemCount To iItems Set Value Of oSelFromCount_fm To iItems Send UpdateDDO End_Procedure // DoInsertItem Procedure DoCutItem Integer iItems Forward Send DoCutItem Get ItemCount To iItems Set Value Of oSelToCount_fm To iItems Send UpdateDDO End_Procedure // DoCutItem Procedure DoCreateTree Integer iItems Forward Send DoCreateTree Get ItemCount To iItems Set Value Of oSelToCount_fm To iItems End_Procedure // DoCreateTree Procedure DoFindMatchingItem Integer iItem Handle hNew Get ItemHandle iItem To hNew // New class function. Set CurrentTreeItem To hNew End_Procedure // DoFindMatchingItem //Function Next_Object_Id Returns Integer // Handle ho // Move (oDbTabPage3(oDbTables_TD(Self))) To ho // Function_Return ho //End_Function // Next_Object_Id //AB-StoreEnd End_Object // oToChildFields_tv Object oAppend_bn is a cBitmapButton Set Label to "&Append Field" Set Size to 14 71 Set Location to 164 7 Set Status_Help to "Append a field to the currently selected Source data table field number" Set peAnchors to anBottomLeft Set Bitmap to "Append16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Handle ho hItem Integer iFile String sLabel sField Move (oFromChildFields_tv(Self)) To ho Get piFile Of ho To iFile Get CurrentTreeItem Of ho To hItem If Not hItem Get RootItem Of ho To hItem Get ItemLabel Of ho hItem To sLabel If (Not(iFile) Or (Length(sLabel) = 0)) Procedure_Return Send Activate Of ho Get IsStartoAppend_dg (Main_DD(Self)) iFile sLabel To sField If (sField <> "") Begin Set ItemLabel Of ho hItem To (String(sLabel) * "+" * String(sField)) Send UpdateDDO Of ho End // If (sField <> "") Begin End_Procedure // OnClick //AB-StoreEnd End_Object // oAppend_bn Object oSelFromCount_fm is a cRDSForm Set Label to "Select Count" Set Size to 13 21 Set Location to 164 126 Set Status_Help to "Number of selected fields/columns for the source table" Set peAnchors to anBottomRight Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSelFromCount_fm Object oSelToCount_fm is a cRDSForm Set Label to "Select Target Count" Set Size to 13 21 Set Location to 164 273 Set Status_Help to "Number of selected fields/columns for the Target table" Set peAnchors to anBottomRight Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSelToCount_fm Object oTextBox1 is a cRDSTextbox Set Label to "->" Set Location to 92 147 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox1 Object oTextBox2 is a cRDSTextbox Set Label to "->" Set Location to 102 147 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox2 Object oTextBox3 is a cRDSTextbox Set Label to "->" Set Location to 112 147 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox3 Object oTextBox4 is a cRDSTextbox Set Label to "->" Set Location to 122 147 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox4 Object oTextBox7 is a cRDSTextbox Set Label to "->" Set Location to 131 147 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox7 Object oTextBox13 is a cRDSTextbox Set Label to "->" Set Location to 140 147 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox13 Object oTextBox14 is a cRDSTextbox Set Label to "->" Set Location to 149 147 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox14 //AB-StoreStart Procedure DoEnableDisable Integer iType Set Enabled_State To (iType = 3) End_Procedure // DoEnableDisable Procedure Set Enabled_State Boolean bState Handle ho Forward Set Enabled_State To bState Send Enable_Window Of (Label_Object(oSelFromCount_fm(Self))) bState Send Enable_Window Of (Label_Object(oSelToCount_fm(Self))) bState Set Enabled_State Of oAppend_bn To bState End_Procedure // Set Enabled_State On_Key Key_Alt+Key_A Send KeyAction Of oAppend_bn //AB-StoreEnd End_Object // oSelectedFields_grp //AB-StoreStart Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set Enabled_State Of oSnctable_Synchtype To (iFromFile And iToFile) End_Procedure // DoUpdateData On_Key Key_Alt+Key_V Send KeyAction Of oViewFromData_bn On_Key Key_Alt+Key_D Send KeyAction Of oViewToData_bn //AB-StoreEnd End_Object // oDbTabPage2 Object oDbTabPage3 is a cRDSDbTabPage Set Label to "Index/Sorting" Set Tab_ToolTip_Value to "Index to use to finding an equal Destination table record" Set piImageIndex to 6 Object oFromIndex_grp is a cRDSDbGroup Set Size to 146 540 Set Location to 1 3 Set peAnchors to anLeftRight Set Label to "Source Database Table Index (Only available when 'Auto delete old records' is checked. See below)" Object oSnctable_FromdataTable_Index is a cRDSDbForm Entry_Item Snctable.Fromdatatable Set Label to "Table Name" Set Size to 13 150 Set Location to 10 78 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSnctable_FromdataTable_Index Object oSnctable_Fromindex is a cDbIndexComboform //AB-StoreTopStart Set pbFrom To True //AB-StoreTopEnd Entry_Item Snctable.Fromindex Set Label to "Select Unique Index" Set Size to 13 150 Set Location to 25 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to TRUE Set Code_Display_Mode to cb_Code_Display_Both //AB-StoreStart Procedure OnChange Forward Send OnChange Send DoCreateTree Of oChildToFields_tv Send OnCreateTree Of oFromIndexFields_tv End_Procedure // OnChange //AB-StoreEnd End_Object // oSnctable_Fromindex Object oViewFromData_bn is a cViewDataButton Set Label to "&View Data" Set Size to 14 60 Set Location to 40 78 Set Status_Help to "View data for the Source database table." Set Bitmap to "ViewData16.bmp" Set piTransparentColor to clFuchsia Set pbFrom to TRUE //AB-StoreStart Procedure OnClick Send DoViewData True -1 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewFromData_bn Object oSnctable_Fridxselcount is a cRDSDbForm Entry_Item Snctable.Fridxselcount Set Label to "Select Count" Set Size to 13 23 Set Location to 130 205 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSnctable_Fridxselcount Object oParentToFields_tb is a cRDSTextbox Set Label to "Available Target Field Numbers:" Set Location to 14 246 Set Size to 10 101 Set TypeFace to "MS Sans Serif" End_Object // oParentToFields_tb Object oParentToFields_tv is a cParentFieldsTreeView //AB-StoreTopStart Set pbFrom To False //AB-StoreTopEnd Set peAnchors to anTopLeftRight Set Size to 54 140 Set Location to 25 246 Set Status_Help to "Double-click or press space-bar or the Ins key to select a Target field" //AB-StoreStart Set psToolTipTitle To (Label(oParentToFields_tb(Self))) Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set piFile To iToFile End_Procedure // DoUpdateData //AB-StoreEnd End_Object // oParentToFields_tv Object oInfo_tb is a cRDSTextbox Set Label to "Select the fields that should be used to populate the Source table's index, to do a find equal search. Only used when 'Auto delete old records' is checked." Set Auto_Size_State to FALSE Set Location to 25 394 Set Size to 54 140 Set Border_Style to Border_StaticEdge Set Justification_Mode to jMode_Left Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oInfo_tb Object oChildToFields_tb is a cRDSTextbox Set Label to "Selected Target Field Numbers:" Set Location to 79 246 Set Size to 10 101 Set TypeFace to "MS Sans Serif" End_Object // oChildToFields_tb Object oChildToFields_tv is a cChildFieldsTreeView //AB-StoreTopStart Property Handle phoCount (oSnctable_Fridxselcount(Self)) //AB-StoreTopEnd Set peAnchors to anBottomLeftRight Set Size to 54 140 Set Location to 89 246 Set phoParent to (oParentToFields_tv(Self)) Set psFieldName to "ToFieldsFromIdx" Set Status_Help to "Double-click or press the Del key to de-select a Target field." Set pbFrom to FALSE Set Server to (Main_DD(Self)) //AB-StoreStart Set psToolTipTitle To (Label(oChildToFields_tb(Self))) Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set piFile To iFromFile Send OnCreateTree End_Procedure // DoUpdateData Procedure UpdateDDO Send DoUpdateDDBuffer (Main_DD(Self)) "ToFieldsFromIdx" "FrIdxSelCount" // Class procedure. End_Procedure // UpdateDDO Procedure DoAddItem String sLabel Integer iData Forward Send DoAddItem sLabel iData Send UpdateDDO End_Procedure // DoAddItem Procedure DoInsertItem String sLabel Integer iData Forward Send DoInsertItem sLabel iData Send UpdateDDO End_Procedure // DoInsertItem Procedure DoCutItem Forward Send DoCutItem Send UpdateDDO End_Procedure // DoCutItem //AB-StoreEnd End_Object // oChildToFields_tv Object oFromIndexFields_tb is a cRDSTextbox Set Label to "Source Index Segments:" Set Location to 79 397 Set Size to 10 79 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oFromIndexFields_tb Object oFromIndexFields_tv is a cRDSTreeView Set peAnchors to anBottomRight Set Size to 54 140 Set Location to 89 394 Set piBackColor to clLtGray Set TreeRootLinesState to FALSE Set TreeLinesState to FALSE Set TreeButtonsState to FALSE //AB-StoreStart Set psToolTipTitle To (Label(oFromIndexFields_tb(Self))) Set Status_Help To "The segments (or fields) that the selected Source index consist of." Procedure DoDeleteAllData Handle hRootItem Get RootItem To hRootItem While (hRootItem <> 0) Send DoDeleteItem hRootItem Get RootItem To hRootItem Loop End_Procedure // DoDeleteAllData Procedure OnCreateTree Handle hItem Integer iFile iIndex iFields iField iCount iType iLength iPrec iOpen String sFieldName sSpace sChar sType Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromFile To iFile Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromIndex To iIndex Send DoDeleteAllData If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen If Not iOpen Procedure_Return Get_Attribute DF_INDEX_NUMBER_SEGMENTS Of iFile iIndex To iFields For iCount From 1 To iFields Move "" To sSpace If (iFields >= 10 And iCount < 10) Move " " To sSpace Get_Attribute DF_INDEX_SEGMENT_FIELD Of iFile iIndex iCount To iField Get FieldSpecs iFile iField To sFieldName // Function in SyncFuncs.pkg Get AddTreeItem (sSpace + String(iCount) * "-" * sFieldName) 0 iCount 0 0 To hItem Loop End_Procedure // DoCreateTree //AB-StoreEnd End_Object // oFromIndexFields_tv //AB-StoreStart Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Handle ho String sTable Integer iOpen bState Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromDataTable To sTable Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.Delete_Records To bState If iFromFile Get_Attribute DF_FILE_OPENED Of iFromFile To iOpen Set Enabled_State To (iOpen And Length(sTable) > 0 And bState) End_Procedure // DoUpdateData Procedure Set Enabled_State Boolean bState Integer iColor Forward Set Enabled_State To bState If bState Move clNone To iColor Else Move clLtGray To iColor Set piBackColor Of oParentToFields_tv To iColor Set piBackColor Of oChildToFields_tv To iColor End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oFromIndex_grp Object oToIndex_grp is a cRDSDbGroup Set Size to 148 540 Set Location to 148 3 Set peAnchors to anAll Set Label to "Target Database Table Index" Object oSnctable_TodataTable_Index is a cRDSDbForm Entry_Item Snctable.Todatatable Set Label to "Table Name" Set Size to 13 150 Set Location to 10 78 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSnctable_TodataTable_Index Object oSnctable_Toindex is a cDbIndexComboform //AB-StoreTopStart Set pbFrom To False //AB-StoreTopEnd Entry_Item Snctable.Toindex Set Label to "Select Unique Index" Set Size to 13 150 Set Location to 25 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to TRUE Set Code_Display_Mode to cb_Code_Display_Both //AB-StoreStart Procedure OnChange Forward Send OnChange Send DoCreateTree Of oChildFromFields_tv Send OnCreateTree Of oToIndexFields_tv End_Procedure // OnChange //AB-StoreEnd End_Object // oSnctable_Toindex Object oSnctable_Delete_Records is a cRDSDbCheckBox Entry_Item Snctable.Delete_records Set Label to "Auto delete old records" Set Size to 13 115 Set Location to 40 78 //AB-StoreStart Procedure OnChange Handle ho Boolean bState Get Select_State To bState Set Enabled_State Of oFromIndex_grp To bState Set Enabled_State Of (oViewFromData_bn(oFromIndex_grp(Self))) To bState Get Label_Object Of (oSnctable_FromdataTable_Index(Self)) To ho Send Enable_Window Of ho bState Get Label_Object Of (oSnctable_FrIdxSelCount(Self)) To ho Send Enable_Window Of ho bState End_Procedure Function Next_Object_Id Returns Integer Handle ho Move (oParentFromFields_tv(Self)) To ho Function_Return ho End_Function // Next_Object_Id //AB-StoreEnd End_Object // oSnctable_Delete_Records Object oViewToData_bn is a cViewDataButton Set Label to "View &Data" Set Size to 14 60 Set Location to 54 78 Set Status_Help to "View data for the Target database table." Set Bitmap to "ViewData16.bmp" Set Enabled_State to FALSE Set piTransparentColor to clFuchsia Set pbFrom to FALSE //AB-StoreStart Procedure OnClick Send DoViewData True -1 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewToData_bn Object oSnctable_Toidxselcount is a cRDSDbForm Entry_Item Snctable.Toidxselcount Set Label to "Select Count" Set Size to 13 23 Set Location to 130 204 Set peAnchors to anBottomRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSnctable_Toidxselcount Object oParentFromFields_tb is a cRDSTextbox Set Label to "Available Source Field Numbers:" Set Location to 14 246 Set Size to 10 103 Set TypeFace to "MS Sans Serif" End_Object // oParentFromFields_tb Object oParentFromFields_tv is a cParentFieldsTreeView //AB-StoreTopStart Set pbFrom To True //AB-StoreTopEnd Set peAnchors to anTopLeftRight Set Size to 54 140 Set Location to 25 246 Set pbFullRowSelect to TRUE Set TreeButtonsState to FALSE Set TreeRetainSelState to TRUE Set Status_Help to "Double-click or press space-bar or the Ins key to select a Source field" //AB-StoreStart Set psToolTipTitle To (Label(oParentFromFields_tb(Self))) Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set piFile To iFromFile End_Procedure // DoUpdateData //AB-StoreEnd End_Object // oParentFromFields_tv Object oInfo_tb is a cRDSTextbox Set Label to "Select the fields that should be used to populate the Target table's index, to do a find equal search." Set Auto_Size_State to FALSE Set Location to 25 394 Set Size to 54 140 Set Border_Style to Border_StaticEdge Set Justification_Mode to jMode_Left Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oInfo_tb Object oChildFromFields_tb is a cRDSTextbox Set Label to "Selected Source Field Numbers:" Set Location to 79 246 Set Size to 10 103 Set TypeFace to "MS Sans Serif" End_Object // oChildFromFields_tb Object oChildFromFields_tv is a cChildFieldsTreeView //AB-StoreTopStart Property Handle phoCount (oSnctable_Toidxselcount(Self)) //AB-StoreTopEnd Set peAnchors to anAll Set Size to 54 140 Set Location to 89 246 Set phoParent to (oParentFromFields_tv(Self)) Set psFieldName to "FromFieldsToIdx" Set Status_Help to "Double-click or press the Del key to de-select a Source field." Set pbFrom to TRUE Set Server to (Main_DD(Self)) //AB-StoreStart Set psToolTipTitle To (Label(oChildFromFields_tb(Self))) Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set piFile To iFromFile Send OnCreateTree End_Procedure // DoUpdateData Procedure UpdateDDO Send DoUpdateDDBuffer (Main_DD(Self)) "FromFieldsToIdx" "ToIdxSelCount" End_Procedure // UpdateDDO Procedure DoAddItem String sLabel Integer iData Boolean bOk Get IsCheckSegmentCount To bOk If Not bOk Procedure_Return Forward Send DoAddItem sLabel iData Send UpdateDDO End_Procedure // DoAddItem Procedure DoInsertItem String sLabel Integer iData Boolean bOk Get IsCheckSegmentCount To bOk If Not bOk Procedure_Return Forward Send DoInsertItem sLabel iData Send UpdateDDO End_Procedure // DoInsertItem Procedure DoCutItem Forward Send DoCutItem Send UpdateDDO End_Procedure // DoCutItem Function IsCheckSegmentCount Returns Boolean Integer iItems iSegments Get Value Of (phoCount(Self)) To iItems Get ItemCount Of (oToIndexFields_tv(Self)) To iSegments If (iItems >= iSegments) Send Info_Box "The number of fields to fill the selected index has already been reached. If you want to add another field, you first need to delete a field by pressing the 'Del' key, in this list." Function_Return (iItems < iSegments) End_Function // //Procedure DoCreateTree // Integer iItems // Forward Send DoCreateTree //End_Procedure // DoCreateTree //AB-StoreEnd End_Object // oChildFromFields_tv Object oToIndexFields_tb is a cRDSTextbox Set Label to "Target Index Segments:" Set Location to 79 394 Set Size to 10 77 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oToIndexFields_tb Object oToIndexFields_tv is a cRDSTreeView Set peAnchors to anTopBottomRight Set Size to 54 140 Set Location to 89 394 Set piBackColor to clLtGray Set TreeRootLinesState to FALSE Set TreeLinesState to FALSE Set TreeButtonsState to FALSE //AB-StoreStart Set psToolTipTitle To (Label(oToIndexFields_tb(Self))) Set Status_Help To "The segments (or fields) that the selected Target index consist of." Procedure DoDeleteAllData Handle hRootItem Get RootItem To hRootItem While (hRootItem <> 0) Send DoDeleteItem hRootItem Get RootItem To hRootItem Loop End_Procedure // DoDeleteAllData Procedure OnCreateTree Handle hItem Integer iFile iIndex iFields iField iCount iType iLength iPrec iOpen String sFieldName sSpace sChar sType Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToFile To iFile Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToIndex To iIndex Send DoDeleteAllData If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen If Not iOpen Procedure_Return Get_Attribute DF_INDEX_NUMBER_SEGMENTS Of iFile iIndex To iFields For iCount From 1 To iFields Move "" To sSpace If (iFields >= 10 And iCount < 10) Move " " To sSpace Get_Attribute DF_INDEX_SEGMENT_FIELD Of iFile iIndex iCount To iField Get FieldSpecs iFile iField To sFieldName Get AddTreeItem (sSpace + String(iCount) * "-" * sFieldName) 0 iCount 0 0 To hItem Loop End_Procedure // DoCreateTree //Function Next_Object_Id Returns Integer // Handle ho // Move (oDbTabPage4(oDbTables_TD(Self))) To ho // Function_Return ho //End_Function // Next_Object_Id //AB-StoreEnd End_Object // oToIndexFields_tv Object oTextBox8 is a cRDSTextbox Set Label to "->" Set Location to 90 386 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox8 Object oTextBox9 is a cRDSTextbox Set Label to "->" Set Location to 99 386 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox9 Object oTextBox10 is a cRDSTextbox Set Label to "->" Set Location to 108 386 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox10 Object oTextBox11 is a cRDSTextbox Set Label to "->" Set Location to 116 386 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox11 Object oTextBox12 is a cRDSTextbox Set Label to "->" Set Location to 124 386 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox12 Object oTextBox16 is a cRDSTextbox Set Label to "->" Set Location to 133 386 Set Size to 10 7 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight End_Object // oTextBox16 //AB-StoreStart Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Handle ho String sTable Integer iOpen Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDataTable To sTable If iToFile Get_Attribute DF_FILE_OPENED Of iToFile To iOpen Set Enabled_State To (iOpen And Length(sTable) > 0) End_Procedure // DoUpdateData Procedure Set Enabled_State Boolean bState Handle ho Integer iColor Forward Set Enabled_State To bState Get Label_Object Of (oSnctable_TodataTable_Index(Self)) To ho Send Enable_Window Of ho bState Get Label_Object Of (oSnctable_ToDatabase(Self)) To ho Send Enable_Window Of ho bState Get Label_Object Of (oSnctable_FrIdxSelCount(Self)) To ho Send Enable_Window Of ho bState Get Label_Object Of (oSnctable_ToIdxSelCount(Self)) To ho Send Enable_Window Of ho bState If bState Move clNone To iColor Else Move clLtGray To iColor Set piBackColor Of oParentFromFields_tv To iColor Set piBackColor Of oChildFromFields_tv To iColor End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oToIndex_grp //AB-StoreStart On_Key Key_Alt+Key_V Send KeyAction Of oViewFromData_bn On_Key Key_Alt+Key_D Send KeyAction Of oViewToData_bn //AB-StoreEnd End_Object // oDbTabPage3 Object oDbTabPage4 is a cRDSDbTabPage Set Label to "Filters" Set Tab_ToolTip_Value to "Filters or selections for the source table" Set piImageIndex to 7 Object oConstraints_grp is a cRDSDbGroup Set Size to 295 540 Set Location to 1 3 Set peAnchors to anAll Set Label to "Filters/Selections for the source table. Use it if only some records for the source table should be selected" Object oFields_cf is a cDbFieldComboform Set Label to "Field/Column Number" Set Size to 13 150 Set Location to 25 78 Set Status_Help to "Fields/columns for the selected Source data table" Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to FALSE Set Code_Display_Mode to cb_Code_Display_Description Set pbFrom to TRUE //AB-StoreStart Procedure OnChange Handle hoList String sType sField Integer iLength iPrec iField iFile iType iOpen Move -1 To iType Get Value Item 0 To sField Get FileFieldNumber To iField // Class function. Move (Trim(sField)) To sField If (sField Contains "" Or sField = "") Begin Set Value Of oValue_fm To "" Set Value Of oType_fm To "" Set Value Of oLength_fm To "" Set Enabled_State Of oSelect_bn To False Procedure_Return End // If (sField Contains "" Or sField = "") Begin Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromFile To iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen If Not iOpen Procedure_Return Get_Attribute DF_FIELD_TYPE Of iFile iField To iType Get_Attribute DF_FIELD_LENGTH Of iFile iField To iLength Get_Attribute DF_FIELD_PRECISION Of iFile iField To iPrec If (iType = DF_BCD) Move (iLength - iPrec) To iLength Else Move 0 To iPrec Get_Attribute DF_FIELD_NAME Of iFile iField To sField Get UpperFirstChar sField To sField Get FieldType iType To sType Set Value Of oType_fm To sType Set Value Of oLength_fm To (String(iLength) + "," + String(iPrec)) Set psField Of oConstraints_lst To sField Set piType Of oConstraints_lst To iType Send DoEnableDisable Of oSelect_bn 0 End_Procedure // OnChange //Procedure DoCheckClear // Integer iItem // String sField // Get WinCombo_Current_Item To iItem // Get WinCombo_Value item iItem To sField // Forward Send DoCheckClear // Set Value item 0 To "- " //End_Procedure // DoCheckClear // This is a dbComboform but not attached to a db field. // We kill these two procedures so the DDO doesn't get triggered: Procedure Set Changed_Value Integer iField String sValue End_Procedure Procedure Set Changed_State Boolean bState End_Procedure //AB-StoreEnd End_Object // oFields_cf Object oMode_cf is a cRDSComboForm Set Label to "Mode" Set Size to 13 47 Set Location to 25 256 Set Status_Help to "Logical operators to use for the filter" Set Form_Border to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State Item 0 to FALSE Set Combo_Sort_State to FALSE //AB-StoreStart Procedure OnChange Integer iItem String sMode Get WinCombo_Current_Item To iItem Get WinCombo_Value Item iItem To sMode If (Trim(sMode) = "") Move "<" To sMode Set psMode Of oConstraints_lst To sMode End_Procedure // OnChange Procedure Combo_Fill_List Send Combo_Add_Item "<" Send Combo_Add_Item "<=" Send Combo_Add_Item "=" Send Combo_Add_Item "<>" Send Combo_Add_Item ">" Send Combo_Add_Item ">=" Send Combo_Add_Item "Matches" Send Combo_Add_Item "Contains" Set Value Item 0 To "<" End_Procedure // Combo_fill_list Procedure DoFillList Send Combo_Delete_Data Send Combo_Fill_List End_Procedure Procedure DoCheckClear Send DoFillList End_Procedure // DoCheckClear //AB-StoreEnd End_Object // oMode_cf Object oValue_fm is a cRDSForm Set Label to "Value" Set Size to 13 119 Set Location to 25 330 Set Status_Help to "The value to filter the selected Source data field." Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Procedure OnChange String sValue Get Value Item 0 To sValue Set psValue Of oConstraints_lst To sValue End_Procedure // OnChange Procedure DoCheckClear Set Value To "" End_Procedure // DoCheckClear //Function Next_Object_Id Returns Integer // Handle ho // Move (oDbTabPage5(oDbTables_TD(Self))) To ho // Function_Return ho //End_Function // Next_Object_Id //AB-StoreEnd End_Object // oValue_fm Object oSelect_bn is a cBitmapButton Set Label to "&Select" Set Size to 14 60 Set Location to 24 451 Set Status_Help to "Add the entered filter to the list below" Set Bitmap to "Ok16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Handle ho String sValue sField sText Integer iType iRetval Move (oConstraints_lst(Self)) To ho Get piType Of ho To iType Get psValue Of ho To sValue Get psField Of ho To sField If (sField = "") Begin Send Info_Box "You need to select a field first." Procedure_Return End // If (sField = "") Begin If (iType = DF_DATE Or iType = DF_BCD) Begin If (iType = DF_DATE) Begin Get IsDate sValue To iRetval If Not iRetval Move "Incorrect date format. Hint: Press the 'View Data' button and press Enter on a date." To sText End // If (iType = DF_DATE) Begin If (iType = DF_BCD) Begin Get IsNumeric sValue To iRetval If Not iRetval Move "Value should be numeric." To sText End // If (iType = DF_BCD) Begin If Not iRetval Begin Send Info_Box sText Procedure_Return End // If Not iRetval Begin End // If (iType = DF_DATE Or iType = DF_BCD) Begin Send DoAddToList Of ho Send DoUpdateDDBuffer Of ho End_Procedure // OnClick Procedure DoEnableDisable Integer iValue String sTable sField Integer iFile iOpen Get psField Of oConstraints_lst To sField Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromFile To iFile Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromDataTable To sTable Move (Trim(sTable)) To sTable If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen Set Enabled_State To (Length(sField) > 0 And Length(sTable) > 0 And iOpen) End_Procedure // DoEnableDisable Procedure DoCheckClear Send DoEnableDisable 0 End_Procedure // DoCheckClear //AB-StoreEnd End_Object // oSelect_bn Object oType_fm is a cRDSForm Set Label to "Field/Column Type" Set Size to 13 56 Set Location to 40 330 Set Status_Help to "The selected field/column type" Set Label_Col_Offset to 1 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oType_fm Object oLength_fm is a cRDSForm Set Label to "Length" Set Size to 13 33 Set Location to 40 416 Set Status_Help to "The selected field/column length and precision" Set Label_Col_Offset to 1 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oLength_fm Object oViewFromData_bn is a cViewDataButton Set Label to "&View Data" Set Size to 14 60 Set Location to 40 451 Set Status_Help to "View data for the Source database table." Set Bitmap to "ViewData16.bmp" Set Enabled_State to FALSE Set piTransparentColor to clFuchsia Set pbFrom to TRUE //AB-StoreStart Procedure OnClick Integer iItem String sRetval Get FileFieldNumber Of oFields_cf To iItem // Class function. //Showln "iItem = " iItem Get msg_DoViewData True iItem To sRetval If (Length(sRetval) > 0) Set Value Of oValue_fm To sRetval End_Procedure // OnClick //AB-StoreEnd End_Object // oViewFromData_bn Object oConstraints_lst is a cRDSList //AB-StoreTopStart Property Integer piType -1 Property String psField "" Property String psValue "" Property String psMode "<" //AB-StoreTopEnd Set Label to "Selected Filters (Filters are additive)" Set Size to 190 371 Set Location to 58 78 Set Status_Help to "List with entered filters/selections. Press Del or Ctrl+X to remove an item." Set peAnchors to anAll Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Top //AB-StoreStart Procedure DoAddToList Integer iType String sTable sField sMode sValue sText Get piType To iType Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.Fromdatatable To sTable Get StripExt sTable To sTable Get psField To sField Get psMode To sMode Get psValue To sValue Move ("Constrain" * String(sTable) + "." + String(sField) * String(sMode)) To sText If (iType = DF_ASCII Or iType = DF_TEXT) Move (sText * '"' + String(sValue) + '"') To sText Else Begin If (Trim(sValue) = "") Move 0 To sValue Move (sText * String(sValue)) To sText End // Else Begin Send Add_Item msg_None sText End_Procedure // DoAddToList Procedure DoDeleteItem Integer iItem Get Item_Count To iItem If Not iItem Procedure_Return Get Current_Item To iItem Send Delete_Item iItem Send DoUpdateDDBuffer End_Procedure // DoDeleteItem Procedure DoFillList Handle hoDD Boolean bTableChanged Integer iCount iFile iField iType iPos iConstr iMode iOpen String sTable sField sConstr sMode sValue sText sSrc sChar Set Dynamic_Update_State To False Send Delete_Data Delegate Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.Constraints To sConstr Move (Trim(sConstr)) To sConstr If (Length(sConstr) = 0) Begin Set Dynamic_Update_State To True Procedure_Return End // If (Length(sConstr) = 0) Begin Move (sConstr + "|") To sConstr // Format: "Field_Number|Mode|Value" Get Field_Current_Value Of hoDD Field SncTable.FromFile To iFile Send Ignore_Error Of Error_Info_Object 4105 // 'Bad file number' Get_Attribute DF_FILE_OPENED Of iFile To iOpen Send Trap_Error Of Error_Info_Object 4105 // 'Bad file number' If Not iOpen Begin Set Dynamic_Update_State To True Procedure_Return End // If Not iOpen Begin // This will take care of a special situation. // The user has created a record and has also specified Selfields, he then changes the // datatable comboform to another table... Get Field_Changed_State Of hoDD Field SncTable.FromDataTable To bTableChanged If bTableChanged Begin // Reset DDO buffer value in case user saves the new config. Set Field_Changed_Value Of hoDD Field SncTable.Constraints To "" Set Dynamic_Update_State To True Procedure_Return End // If bTableChanged Begin Get Field_Current_Value Of hoDD Field SncTable.Fromdatatable To sTable Get StripExt sTable To sTable Get Field_Current_Value Of hoDD Field SncTable.ConstrainCount To iConstr For iCount From 1 To iConstr Get ExtractValue sConstr " " To iField // Extract Field Value. (From SyncFuncs.pkg) Move (Replace((String(iField) + " "), sConstr, "")) To sConstr Get_Attribute DF_FIELD_NAME Of iFile iField To sField Get_Attribute DF_FIELD_TYPE Of iFile iField To iType Set piType To iType Move (Uppercase(Left(sField, 1))) To sChar Move (sChar + Right(Lowercase(sField), (Length(sField) -1))) To sField // Uppercase first letter. Set psField To sField Move (Left(sConstr, 1)) To iMode Get ExtractMode sConstr To sMode Move (Replace((String(iMode) + " "), sConstr, "")) To sConstr Set psMode To sMode Get ExtractValue sConstr "|" To sValue Move (Replace((sValue + "|"), sConstr, "")) To sConstr Set psValue To sValue Send DoAddToList Loop // For iCount from 1 to iConstr Set Dynamic_Update_State To True End_Procedure // DoFillList Procedure DoUpdateDDBuffer Handle hoDD Integer iCount iFile iField iPos iItems iMode String sTable sField sConstr sMode sValue sText sSrc Delegate Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.FromFile To iFile If Not iFile Procedure_Return Get Item_Count To iItems For iCount From 0 To (iItems - 1) Get Value Item iCount To sText Move (sText - " ") To sText Move (Pos(".", sText)) To iPos Move (Left(sText, iPos)) To sTable // File: Move (Replace(sTable, sText, "")) To sText Get ExtractValue sText " " To sField // Function in SysFuncs.pkg Field_Map iFile sField To iField // Field: Move (Replace((sField + " "), sText, "")) To sText Get ExtractMode sText To iMode // Mode (Operator) Move (Pos(" ", sText)) To iPos Move (Right(sText, (Length(sText) - iPos))) To sText Get ExtractValue sText " " To sValue Move (Replace((sValue + " "), sText, "")) To sText Move (Replaces('"', sValue, '')) To sValue // Value Move (String(iField) * String(iMode) * String(sValue)) To sText If (iCount < (iItems -1)) Move (sText + "|") To sText Move (sConstr + String(sText)) To sConstr Loop // For iCount from 1 to iConstr Get Field_Current_Value Of hoDD Field SncTable.Constraints To sText If (Trim(sText) <> sConstr) Begin Set Field_Changed_Value Of hoDD Field SncTable.Constraints To sConstr Set Field_Changed_Value Of hoDD Field SncTable.ConstrainCount To iItems End // If (Trim(sText) <> sConstr) Begin End_Procedure // DoUpdateDDBuffer On_Key kDelete_Character Send DoDeleteItem On_Key Key_Shift+Key_F2 Send DoDeleteItem On_Key Key_Ctrl+Key_X Send DoDeleteItem //AB-StoreEnd End_Object // oConstraints_lst Object oSnctable_Constraincount is a cRDSDbForm Entry_Item Snctable.Constraincount Set Label to "Selected No of Filters" Set Size to 13 18 Set Location to 278 431 Set peAnchors to anBottomRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSnctable_Constraincount Object oSnctable_FromdataTable_Filter is a cRDSDbForm Entry_Item Snctable.Fromdatatable Set Label to "Source Table Name" Set Size to 13 150 Set Location to 10 78 Set Label_Row_Offset to 2 Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //Set Label_Shadow_Display_Mode To TBSHADOW_ON_LOCAL Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set Enabled_State Of (Label_Object(Self)) To (iFromFile And iToFile) Send Enable_Window Of (Label_Object(Self)) (iFromFile And iToFile) End_Procedure // DoUpdateData Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSnctable_FromdataTable_Filter //AB-StoreStart Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Handle ho String sTable Integer iOpen Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.Fromdatatable To sTable If iFromFile Get_Attribute DF_FILE_OPENED Of iFromFile To iOpen Set Enabled_State To (Length(sTable) > 0 And iOpen) Move (oConstraints_lst(Self)) To ho If (Enabled_State(Self)) Set Color Of ho To clWindow Else Set Color Of ho To clLtGray Send DoFillList Of ho Set Enabled_State Of (Label_Object(ho)) To (Length(sTable) > 0 And iOpen) Set Enabled_State Of (Label_Object(oType_fm)) To (Length(sTable) > 0 And iOpen) Set Enabled_State Of (Label_Object(oLength_fm)) To (Length(sTable) > 0 And iOpen) Set Enabled_State Of (Label_Object(oSnctable_Constraincount)) To (Length(sTable) > 0 And iOpen) End_Procedure // DoUpdateData On_Key Key_Alt+Key_S Send KeyAction Of oSelect_bn On_Key Key_Alt+Key_V Send KeyAction Of oViewFromData_bn //AB-StoreEnd End_Object // oConstraints_grp //AB-StoreStart On_Key Key_Alt+Key_S Send KeyAction To oSelect_bn //AB-StoreEnd End_Object // oDbTabPage4 Object oDbTabPage5 is a cRDSDbTabPage //AB-StoreTopStart Property Integer piFile 0 Property Boolean pbUpdateOk True Property String psDefaults '' //AB-StoreTopEnd Set Label to "Null Defaults" Set Tab_ToolTip_Value to "Null defaults for the Destination table to use for undefined Source table values." Set piImageIndex to 8 Object oNullDefaults_grp is a cRDSDbGroup Set Size to 295 540 Set Location to 1 3 Set peAnchors to anTopBottom Set Label to "Null Defaults" Object oInfo_tb is a cRDSTextbox Set Label to " Used when a source table's field value is undefined. It is suggested that you specify Default Values for formats other than the DataFlex Embedded Database." Set Location to 28 6 Set Size to 10 495 Set TypeFace to "MS Sans Serif" Set peAnchors to anTopLeft End_Object // oInfo_tb Object oValues_grd is a cRDSGrid Set Size to 245 352 Set Location to 42 78 Set Highlight_Row_state to TRUE Set peAnchors to anAll Set peResizeColumn to rcAll Set GridLine_Mode to GRID_VISIBLE_VERT Set Line_Width to 6 0 Set Form_Width item 0 to 80 Set Header_Label item 0 to "Field/Column Name" Set Form_Width item 1 to 42 Set Header_Label item 1 to "Type" Set Form_Width item 2 to 36 Set Header_Label item 2 to "Length" Set Form_Width item 3 to 48 Set Header_Label item 3 to "Null Allowed" Set Form_Width item 4 to 60 Set Header_Label item 4 to "Defined Default" Set Form_Width item 5 to 80 Set Header_Label item 5 to "Use Default Value" //AB-StoreStart Set psToolTipTitle To "Null Default Values" Set psToolTip To "Enter default values in the 'Use Default Value' column. The entered default value will be used if source data is considered to be Null or 'undefined' by the target database. Note: The entered single quotes ' will not get inserted. They are only used to make it easier to distinguish entered space characters." //Set Status_Help Item 0 To "Enter default values in the 'Use Default Value' column. The entered default value will be used if source data is considered to be Null or 'undefined' by the target database. Note: The entered single quotes ' will not get inserted. They are only used to make it easier to distinguish entered space characters." //Set Status_Help Item 0 To "Field or column name" //Set Status_Help Item 1 To "The type of the field" //Set Status_Help Item 2 To "The length and precision of the field" //Set Status_Help Item 3 To "If checked field is defined as Nullable. That is the field accepts Null values. Important: Never use nullable fields/columns that are part of indexes, it will make searching a lot slower." //Set Status_Help Item 4 To "Predefined default value (if any)" Procedure DoFillGrid Handle hoDD Boolean bTableChanged Integer iFile iCount iFields iType iLength iPrec Integer iNul iOpen iItmCnt iItem iDbType String sDefaults sValue sField sType sDefaultValue sLength Set Dynamic_Update_State To False Send Delete_Data Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.ToFile To iFile If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen If Not iOpen Begin Set Dynamic_Update_State To True Procedure_Return End // If Not iOpen Begin Get Field_Current_Value Of hoDD Field SncTable.ToDbType To iDbType // If (iDbType < 2 Or iDbType = 6) Begin // Set Dynamic_Update_State To True // Procedure_Return // End // If (iDbType < 2 Or iDbType = 6) Begin Get Field_Changed_State Of hoDD Field SncTable.ToDataTable To bTableChanged If bTableChanged Begin // Reset DDO buffer value in case user saves the new config. Set Field_Changed_Value Of hoDD Field SncTable.ToDefaults To "" End // If bTableChanged Begin Send Default_Value Of oDate_fm iDbType // Sets proper default date depending on selected driver. Get Field_Current_Value Of hoDD Field SncTable.ToDefaults To sDefaults Move (Trim(sDefaults)) To sDefaults Get_Attribute DF_FILE_NUMBER_FIELDS Of iFile To iFields Get Item_Count To iItmCnt Decrement iItmCnt Move 0 To iItem Send Ignore_Error Of Error_Info_Object 77 Indicate Err False Set Select_Mode To Multi_Select For iCount From 1 To iFields // Field name: Get_Attribute DF_FIELD_NAME Of iFile iCount To sField Get UpperFirstChar sField To sField If (iItem > iItmCnt) Send Add_Item Msg_None sField Else If (Value(Current_Object, iItem) <> sField) ; Set Value Item iItem To sField Set Entry_State Item iItem To False Set ItemColor Item iItem To clBtnFace Increment iItem // Type: Get_Attribute DF_FIELD_TYPE Of iFile iCount To iType Get FieldType iType To sType If (iItem > iItmCnt) Send Add_Item Msg_None sType Else If (Value(Current_Object, iItem) <> sType) ; Set Value Item iItem To sType Set Entry_State Item iItem To False Set ItemColor Item iItem To clBtnFace Increment iItem // Length: // This new attribute does not work: // Get_Attribute DF_FIELD_LENGTH_STRING Of iFile iCount To sLength // NEW PROPERTY!!! Get_Attribute DF_FIELD_LENGTH Of iFile iCount To iLength Get_Attribute DF_FIELD_PRECISION Of iFile iCount To iPrec If (iType = DF_BCD) Move (iLength - iPrec) To iLength Else Move 0 To iPrec Move (String(iLength) + "," + String(iPrec)) To sLength If (iItem > iItmCnt) Send Add_Item msg_None sLength Else If (Value(Current_Object, iItem) <> sLength) ; Set Value Item iItem To sLength Set Entry_State Item iItem To False Set ItemColor Item iItem To clBtnFace Increment iItem // Nullable: Get_Attribute DF_FIELD_NULL_ALLOWED Of iFile iCount To iNul If (iItem > iItmCnt) Send Add_Item Msg_None "" Set Checkbox_Item_State Item iItem To True Set Select_State Item iItem To iNul Set Entry_State Item iItem To False Set ItemColor Item iItem To clBtnFace Increment iItem // Default Value: Get_Attribute DF_FIELD_DEFAULT_VALUE Of iFile iCount To sDefaultValue If (iItem > iItmCnt) Send Add_Item msg_None sDefaultValue Set Entry_State Item iItem To False Set ItemColor Item iItem To clBtnFace Set Shadow_State Item iItem To True Increment iItem // Null Default Value to be entered: If (Length(sDefaults)) ; Get ExtractFieldValue sDefaults iCount To sValue Else Move "" To sValue Send Add_Item msg_None sValue Increment iItem If (Err) Break // Has been set to False before the loop. Loop // For iCount From 1 To iFields Send Trap_Error Of Error_Info_Object 77 Set Dynamic_Update_State To True Set Select_Mode To No_Select End_Procedure // DoFillGrid Function ExtractFieldValue String sDefaults Integer iField Returns String Integer iStart iEnd iCount For iCount From 1 To (iField - 1) Move (Replace("|", sDefaults, "")) To sDefaults Loop // For iCount from 1 to iField Move (Pos("|", sDefaults)) To iStart Move (Replace("|", sDefaults, "")) To sDefaults Move (Pos("|", sDefaults)) To iEnd Function_Return (Mid(sDefaults, (iEnd - iStart), iStart)) End_Function // ExtractFieldValue Procedure DoApplyNewValues String sAscii String sText String sNumeric String sDate String sBinary Integer iItems iCount iCols String sType If (sAscii Contains "|" Or sText Contains "|" Or sNumeric Contains "|" Or sDate Contains "|" Or sBinary Contains "|") Begin Send Info_Box ("Sorry, the vertical bar character (|) cannot be used for a default value. It is used as a divider when the defaults are saved to the SncTable record.") Procedure_Return End Get Item_Count To iItems Get Line_Size To iCols Decrement iCols Set Dynamic_Update_State To False For iCount From 0 To (iItems - 1) Get Value Item (iCount + 1) To sType If (sType = "ASCII") Set Value Item (iCount + 5) To sAscii Else If (sType = "Numeric") Set Value Item (iCount + 5) To sNumeric Else If (sType = "Date") Set Value Item (iCount + 5) To sDate Else If (sType = "Text") Set Value Item (iCount + 5) To sText Else If (sType = "Binary") Set Value Item (iCount + 5) To sBinary Move (iCount + iCols) To iCount Loop Set Dynamic_Update_State To True // Send DoUpdateDDBuffer End_Procedure // DoApplyNewValues Procedure DoRemoveValues Integer iItems iCount iCols Get Item_Count To iItems Get Line_Size To iCols Decrement iCols Set Dynamic_Update_State To False For iCount From 0 To (iItems - 1) Set Value Item (iCount + 5) To '' Move (iCount + iCols) To iCount Loop Set Dynamic_Update_State To True // Send DoUpdateDDBuffer End_Procedure // DoRemoveValues Procedure DoUpdateDDBuffer Handle hoDD Integer iItems iCount iCols String sValue sDefaults sCrntDefaults sCheck Delegate Get Main_DD To hoDD Get Item_Count To iItems Get Line_Size To iCols Move "|" To sDefaults For iCount From 0 To (iItems - 1) Get Value Item (iCount + 5) To sValue If (sValue Contains "|") Begin Send Info_Box ("Sorry, the vertical bar character (|) cannot be used for a default value. It is used as a divider when the defaults are saved to the SncTable record.") Procedure_Return End // If (sValue constains "|") Begin Move (sDefaults + String(sValue) + "|") To sDefaults Move (iCount + iCols -1) To iCount Loop Move (Trim(sDefaults)) To sDefaults Move (Repeat("|", (iItems / iCols + 1))) To sCheck If (sCheck = sDefaults) Move " " To sDefaults // Must be a space to be able to save the change to the DDO Get Field_Current_Value Of hoDD Field SncTable.ToDefaults To sCrntDefaults If (Trim(sCrntDefaults) <> sDefaults) Begin Set Field_Changed_Value Of hoDD Field SncTable.ToDefaults To sDefaults Set Field_Changed_Value Of hoDD Field SncTable.ZeroLengthOk To (sDefaults <> "") End End_Procedure // DoUpdateDDBuffer Procedure OnChange Send DoUpdateDDBuffer End_Procedure // OnChange Function Next_Object_Id Integer bNoDescend Returns Integer Handle ho Move (oASCII_fm(oDefaults_grp(Self))) To ho Function_Return ho End_Function // Next_Object_Id On_Key Key_Ctrl+Key_S Send DoSave On_Key Key_F2 Send DoSave //AB-StoreEnd End_Object // oValues_grd Object oDefaults_grp is a cRDSGroup Set Size to 248 103 Set Location to 39 433 Set peAnchors to anTopBottomRight Set Label to "Default Values" Object oASCII_fm is a cRDSForm Set Label to "ASCII Fields" Set Size to 13 97 Set Location to 23 3 Set Status_Help to "Default value to apply for all fields/columns of type ASCII. Surround the value with single quotes." Set peAnchors to anLeftRight Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Top //AB-StoreStart Set Value Item 0 To "' '" //AB-StoreEnd End_Object // oASCII_fm Object oText_fm is a cRDSForm Set Label to "Text Fields" Set Size to 13 97 Set Location to 50 3 Set Status_Help to "Default value to apply for all fields/columns of type Text or Note" Set peAnchors to anLeftRight Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Top //AB-StoreStart Set Value Item 0 To "' '" //AB-StoreEnd End_Object // oText_fm Object oNumeric_fm is a cRDSForm Set Label to "Numeric Fields" Set Size to 13 97 Set Location to 79 3 Set Status_Help to "Default value to apply for all fields/columns of type Number" Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Top //AB-StoreStart Set Value Item 0 To "0" //AB-StoreEnd End_Object // oNumeric_fm Object oDate_fm is a cRDSForm Set Label to "Date Fields" Set Size to 13 97 Set Location to 106 3 Set Status_Help to "Default value to apply for all fields/columns of type Date" Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Top //AB-StoreStart //Set Form_DataType item 0 to Date_Window Set Value Item 0 To "1900-01-01" Procedure Default_Value Integer iDbType Integer iDateFormat String sDefaultDate If (iDbType = 2) Set Value Item 0 To "0001-01-01" // IBM DB2 If (iDbType = 3) Set Value Item 0 To "1753-01-01" // MS SQL If (iDbType = 4) Set Value Item 0 To "1900-01-01" // ODBC If (iDbType = 5) Set Value Item 0 To "1900-01-01" // Oracle If (iDbType = 1 Or iDbType = 6) Begin // Pervasive.SQL Get_Attribute DF_DATE_FORMAT To iDateFormat If (iDateFormat = DF_DATE_USA) Move "01-01-1900" To sDefaultDate If (iDateFormat = DF_DATE_EUROPEAN) Move "01-01-1900" To sDefaultDate If (iDateFormat = DF_DATE_MILITARY) Move "1900-01-01" To sDefaultDate Set Value Item 0 To sDefaultDate End // If (iDbType = 1 Or iDbType = 6) Begin End_Procedure // Default_Value //AB-StoreEnd End_Object // oDate_fm Object oBinary_fm is a cRDSForm Set Label to "Binary Fields" Set Size to 13 97 Set Location to 135 3 Set Status_Help to "Default value to apply for all fields/columns of type Binary" Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Top //AB-StoreStart Set Value Item 0 To "0" //Function Next_Object_Id Returns Integer // Handle ho // Move (oDbTabPage6(oDbTables_TD(Self))) To ho // Function_Return ho //End_Function // Next_Object_Id //AB-StoreEnd End_Object // oBinary_fm Object oApplyAllRows_bn is a cBitmapButton Set Label to "&Apply for All Rows" Set Size to 14 97 Set Location to 213 3 Set Status_Help to "Apply for All rows in the grid to the left" Set peAnchors to anBottom Set Bitmap to "Ok16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick String sAscii sText sNumeric sDate sBinary Get Value Of oAscii_fm To sAscii Get Value Of oText_fm To sText Get Value Of oNumeric_fm To sNumeric Get Value Of oDate_fm To sDate Get Value Of oBinary_fm To sBinary Send DoApplyNewValues Of oValues_grd sAscii sText sNumeric sDate sBinary End_Procedure // OnClick //Procedure DoEnableDisable Integer iValue // String sTable // Integer iFile iOpen // Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToFile To iFile // Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDataTable To sTable // Move (Trim(sTable)) To sTable // If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen // Set Enabled_State To (Length(sTable) > 0 And iOpen) //End_Procedure // DoEnableDisable //Procedure DoCheckClear // Send DoEnableDisable 0 //End_Procedure // DoCheckClear //AB-StoreEnd End_Object // oApplyAllRows_bn Object oRemoveAllRows_bn is a cBitmapButton Set Label to "&Remove all Defaults" Set Size to 14 97 Set Location to 230 3 Set Status_Help to "Remove all 'Use Default Value(s)' from the grid to the left" Set peAnchors to anBottom Set Bitmap to "Delete16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Send DoRemoveValues Of oValues_grd End_Procedure // OnClick //Procedure DoEnableDisable Integer iValue // String sTable // Integer iFile iOpen // Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToFile To iFile // Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDataTable To sTable // Move (Trim(sTable)) To sTable // If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen // Set Enabled_State To (iValue > 0 And Length(sTable) > 0 And iOpen) //End_Procedure // DoEnableDisable //Procedure DoCheckClear // String sTable // Integer iFile iOpen // Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToFile To iFile // Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDataTable To sTable // Move (Trim(sTable)) To sTable // If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen // Set Enabled_State To (Length(sTable) > 0 And iOpen) //End_Procedure // DoCheckClear //AB-StoreEnd End_Object // oRemoveAllRows_bn End_Object // oDefaults_grp Object oSnctable_TodataTable_Null is a cRDSDbForm Entry_Item Snctable.Todatatable Set Label to "Target Table Name" Set Size to 13 150 Set Location to 10 78 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //Set Label_Shadow_Display_Mode To TBSHADOW_ON_LOCAL Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set Enabled_State Of (Label_Object(Self)) To (iFromFile And iToFile) Send Enable_Window Of (Label_Object(Self)) (iFromFile And iToFile) End_Procedure // DoUpdateData Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSnctable_TodataTable_Null Object oViewFromDataNullDefaults_bn is a cViewDataButton Set Label to "&View Data" Set Size to 14 60 Set Location to 10 231 Set Status_Help to "View data for the Source database table." Set Bitmap to "ViewData16.bmp" Set piTransparentColor to clFuchsia Set pbFrom to TRUE //AB-StoreStart Procedure OnClick Send DoViewData True -1 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewFromDataNullDefaults_bn //AB-StoreStart Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Handle ho String sTable Integer iOpen iDbType //Showln "iFromFile = " iFromFile " iToFile = " iToFile " bFrom = " bFrom Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDatatable To sTable If iToFile Get_Attribute DF_FILE_OPENED Of iToFile To iOpen Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDbType To iDbType Set Enabled_State To (Length(sTable) > 0 And iOpen) Set Enabled_State Of oDefaults_grp To (Length(sTable) > 0 And iOpen) // Set Enabled_State Of oApplyAllRows_bn To (Length(sTable) > 0 And iOpen) // Set Enabled_State Of oRemoveAllRows_bn To (Length(sTable) > 0 And iOpen) // Set Enabled_State To (Length(sTable) > 0 And iOpen And "2345" Contains iDbType) Move (oValues_grd(Self)) To ho If (Enabled_State(Self)) Set Color Of ho To clWindow Else Set Color Of ho To clLtGray If ho Send DoFillGrid Of ho End_Procedure // DoUpdateData On_Key Key_Alt+Key_V Send KeyAction Of oViewFromDataNullDefaults_bn //AB-StoreEnd End_Object // oNullDefaults_grp //AB-StoreStart On_Key Key_Alt+Key_A Send KeyAction To oApplyAllRows_bn On_Key Key_Alt+Key_R Send KeyAction To oRemoveAllRows_bn //AB-StoreEnd End_Object // oDbTabPage5 Object oDbTabPage6 is a cRDSDbTabPage Set Label to "Value Conversion" Set Tab_ToolTip_Value to "Change a Source field value into something else for the Target table" Set piImageIndex to 9 Object oSncTRow_grp is a cRDSDbGroup Set Size to 295 540 Set Location to 1 3 Set peAnchors to anAll Set Label to "Field Value Conversions" Object oSnctable_FromdataTable_Conv is a cRDSDbForm Entry_Item Snctable.Fromdatatable Set Label to "Source Table Name" Set Size to 13 150 Set Location to 10 78 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //Set Label_Shadow_Display_Mode To TBSHADOW_ON_LOCAL Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set Enabled_State Of (Label_Object(Self)) To (iFromFile And iToFile) Send Enable_Window Of (Label_Object(Self)) (iFromFile And iToFile) Set Enabled_State Of (oViewFromData_bn(Self)) To iFromFile End_Procedure // DoUpdateData Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSnctable_FromdataTable_Conv Object oFromField_cf is a cDbFieldComboform Entry_Item Sncthea.Fromfield Set Server to Sncthea_DD Set Label to "Source Field" Set Size to 13 150 Set Location to 25 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to FALSE Set Code_Display_Mode to cb_Code_Display_Description Set pbFrom to TRUE //AB-StoreStart //AB-StoreEnd End_Object // oFromField_cf Object oSnctable_TodataTable_Conv is a cRDSDbForm Entry_Item Snctable.Todatatable Set Label to "Target Table Name" Set Size to 13 150 Set Location to 40 78 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //Set Label_Shadow_Display_Mode To TBSHADOW_ON_LOCAL Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set Enabled_State Of (Label_Object(Self)) To (iFromFile And iToFile) Send Enable_Window Of (Label_Object(Self)) (iFromFile And iToFile) End_Procedure // DoUpdateData Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSnctable_TodataTable_Conv Object oToField_cf is a cDbFieldComboform Entry_Item Sncthea.Tofield Set Server to Sncthea_DD Set Label to "Target Field" Set Size to 13 150 Set Location to 55 78 Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to FALSE Set Code_Display_Mode to cb_Code_Display_Description Set pbFrom to FALSE //AB-StoreStart //Function Next_Object_Id Returns Integer // Handle ho // Boolean bState // Get Child_Entering Of (oSncTRow_Grid(Self)) To bState // If (bState = True) Function_Return Self // Move (oDbTabPage2(oDbTables_TD(Self))) To ho // Function_Return ho //End_Function // Next_Object_Id //AB-StoreEnd End_Object // oToField_cf Object oSncTRow_Grid is a cRDSDbGrid Set Main_File to Snctrow.File_Number Set Server to Snctrow_DD Set Ordering to 1 Set Size to 190 280 Set Location to 70 78 Set peAnchors to anAll Set Autosize_height_state to TRUE Set peResizeColumn to rcAll Set Wrap_State to TRUE Set Prompt_Button_Mode to pb_PromptOff Set Prompt_Button_Value to "" Begin_Row Entry_Item Snctrow.Fromvalue Entry_Item Snctrow.Tovalue Entry_Item Snctrow.Ignorecase End_Row Set Form_Width item 0 to 113 Set Header_Label item 0 to "If Source Field Value Equals:" Set Form_Width item 1 to 113 Set Header_Label item 1 to "Update Target Field with:" Set Form_Width item 2 to 47 Set Header_Label item 2 to "Ignore Case" Set Column_Checkbox_State item 2 to True //AB-StoreStart Set Child_Table_State To True Set psToolTipTitle To "Conversion Table" Set psToolTip To "Enter the value in the first column that if found should be changed into the value in the second column. If you check the 'Ignore Case' characters for the Source and Target will be compared in uppercase." // First check that both a From and To field has been selected // with the combos. Else display info to user and refuse entering. // If this is a new validation table autosave the header (SncTHea) before // entering the grid (SncTRow). // This way we hide the fact from the user that this a header/details // construct that is related to the views main_dd (SncTable). Function Child_Entering Returns Integer Handle hoDD hoDD2 Integer iFrom iTo iSncTableRecid iRetval iSncTHeaRecnum iSncTRowRecnum Boolean bState Move (SncTHea_DD(Self)) To hoDD Move (SncTable_DD(Self)) To hoDD2 // This is so odd. The Get Field_Current_Value for SncTHea.FromField // will generate a status 54 even though it works. The ToField works just fine. // I don't have a clue what's going on. So cheat and simply ignore it: Send Ignore_Error Of Error_Info_Object 54 // "Invalid symbol in expression" Get Field_Current_Value Of hoDD Field SncTHea.FromField To iFrom Get Field_Current_Value Of hoDD Field SncTHea.ToField To iTo Get Field_Current_Value Of hoDD Field SncTHea.SncTable_Recid To iSncTableRecid Send Trap_Error Of Error_Info_Object 54 Move (False) To bState Move SncTHea.Recnum To iSncTHeaRecnum Clear SncTHea Move iSncTableRecid To SncTHea.SncTable_Recid Move iFrom To SncTHea.FromField Move iTo To SncTHea.ToField Find Eq SncTHea By Index.1 If (Found) Begin Move SncTRow.Recnum To iSncTRowRecnum Clear SncTRow Move SncTHea.Recid To SncTRow.TransHea_Recid Find Gt SncTRow By Index.2 // Index.2 = TransHea_Recid + Recid If (Found) Move (SncTRow.Transhea_Recid = SncTHea.Recid) To bState End // If (Found) Begin If (bState = False) Begin Clear SncTHea Move iSncTHeaRecnum To SncTHea.Recnum Find Eq SncTHea By Recnum // Reset record buffer. Clear SncTRow Move iSncTRowRecnum To SncTRow.Recnum Find Eq SncTRow By Recnum // Reset record buffer. End // If (bState = False) Begin If (bState = True) Begin Send Request_Assign Of hoDD // Auto-find the existing transformation table. End // If (bState = True) Begin If (iFrom < 1 Or iTo < 1) Begin Send Info_Box "You need to select both a Source and a Destination field from the comboforms above. Please adjust and try again." Function_Return True // Do not enter. End // If (iFrom = 0 or iTo = 0) Begin If Not (Current_Record(hoDD2)) Begin Indicate Err False Get YesNo_Box "You are creating a new 'Database Tables Setup record'. It needs to be saved before a Transformation table can be entered. Save record now?" To iRetval If (iRetval = MBR_NO) Function_Return True Send Request_Save Of hoDD2 If (Err) Function_Return True // Do not enter. End // If Not (Current_Record(hoDD)) Begin If Not (Current_Record(hoDD)) Begin Indicate Err False Send Request_Save Of hoDD If (Err) Function_Return True // Do not enter. End // If Not (Current_Record(hoDD)) Begin Function_Return False End_Function // Child_Entering Procedure Refresh Integer iMode Integer iRecnum Forward Send Refresh iMode Get Current_Record Of SncTHea_DD To iRecnum Set Enabled_State Of oDeleteValueTable_bn To iRecnum End_Procedure // DoUpdateData On_Key Key_F8 Send OnClick Of (oNext_bn(oFindToolbar(oFindButton_c3d(Self)))) On_Key Key_F7 Send OnClick Of (oPrev_bn(oFindToolbar(oFindButton_c3d(Self)))) On_Key Key_Ctrl+Key_Home Send OnClick Of (oFirst_bn(oFindToolbar(oFindButton_c3d(Self)))) On_Key Key_Ctrl+Key_End Send OnClick Of (oLast_bn(oFindToolbar(oFindButton_c3d(Self)))) //AB-StoreEnd End_Object // oSncTRow_Grid Object oSnctable_Sncthea_Count is a cRDSDbForm Entry_Item Snctable.Sncthea_count Set Label to "Number of created Conversion Tables" Set Size to 13 24 Set Location to 262 334 Set peAnchors to anBottomRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSnctable_Sncthea_Count Object oNewValueTable_bn is a cBitmapButton Set Label to "Create &New Table" Set Size to 14 87 Set Location to 276 78 Set Status_Help to "Create a new Transformation Table for a different set of Source and Target fields." Set peAnchors to anBottomLeft Set Bitmap to "New16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Send DoCreateNewRecord Of SncTHea_DD Send Activate Of oFromField_cf End_Procedure // OnClick Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Forward Send DoUpdateData iFromFile iToFile bFrom Set Enabled_State To (iFromFile And iToFile) End_Procedure // DoUpdateData //AB-StoreEnd End_Object // oNewValueTable_bn Object oViewToData_bn is a cViewDataButton Set Label to "View &Data" Set Size to 14 60 Set Location to 40 230 Set Status_Help to "View data for the Target database table." Set Bitmap to "ViewData16.bmp" Set Enabled_State to FALSE Set piTransparentColor to clFuchsia Set pbFrom to FALSE //AB-StoreStart Procedure OnClick Send DoViewData True -1 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewToData_bn Object oViewFromData_bn is a cViewDataButton Set Label to "&View Data" Set Size to 14 60 Set Location to 10 230 Set Status_Help to "View data for the Source database table." Set Bitmap to "ViewData16.bmp" Set Enabled_State to FALSE Set piTransparentColor to clFuchsia Set pbFrom to TRUE //AB-StoreStart Procedure OnClick Send DoViewData True -1 End_Procedure // OnClick //Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom // Forward Send DoUpdateData iFromFile iToFile bFrom //End_Procedure // DoUpdateData //AB-StoreEnd End_Object // oViewFromData_bn Object oFindButton_c3d is a cRDSContainer3d Set Size to 15 62 Set Location to 276 166 Set peAnchors to anBottomLeft //AB-StoreStart Object oFindToolbar Is A cToolbar Set pbInMDIPanel To False Set pbWrapable To False Set pbNoDivider To True // Set pbFlat To False // Displayes the toolbar raised. This is what makes it look like a button. Set piIndent To 0 Object oImages Is An cImageList Set piMaxImages To 4 Procedure OnCreate Integer iVoid Get AddTransparentImage "Bgn.bmp" clFuchsia To iVoid Get AddTransparentImage "Prev.bmp" clFuchsia To iVoid Get AddTransparentImage "Next.bmp" clFuchsia To iVoid Get AddTransparentImage "End.bmp" clFuchsia To iVoid End_Procedure // onCreate End_Object // oImages Object oImagesHot Is A cRDScImageList // These images are shown when the mouse cursor hovers over the button // There must be a matching number of images in all imagelists. Set piMaxImages To 4 Procedure OnCreate Integer iVoid Get AddTransparentImage "BgnHot.bmp" clLtGray To iVoid Get AddTransparentImage "PrevHot.bmp" clLtGray To iVoid Get AddTransparentImage "NextHot.bmp" clLtGray To iVoid Get AddTransparentImage "EndHot.bmp" clLtGray To iVoid End_Procedure End_Object Set phoImageList To (oImages(Self)) // Set phoImageListHot To (oImagesHot(Self)) Object oFirst_bn Is A cToolbarButton Set pbAutoSize To True Set psTooltip To "Find the first transformation table (Ctrl+Home)" Set piImage To 0 Procedure OnClick Send DoFindRecord Of SncTHea_DD -1 End_Procedure End_Object Object oPrev_bn Is A cToolbarButton Set pbAutoSize To True Set psToolTip To "Find previous conversion table (F7)" Set piImage To 1 Procedure OnClick Send DoFindRecord Of SncTHea_DD Lt End_Procedure // OnClick End_Object // oPrev Object oNext_bn Is A cToolbarButton Set pbAutoSize To True Set psTooltip To "Find next conversion table (F8)" Set piImage To 2 Procedure OnClick Send DoFindRecord Of SncTHea_DD Gt End_Procedure // OnClick End_Object // oNext Object oLast_bn Is A cToolbarButton Set pbAutoSize To True Set psTooltip To "Find the last conversion table (Ctrl+End)" Set piImage To 3 Procedure OnClick Send DoFindRecord Of SncTHea_DD -2 End_Procedure End_Object Procedure Add_Focus Integer hoBase Returns Integer Integer iRetVal Integer iSize Get GuiSize Of (Parent(Self)) To iSize Set GuiSize To (Hi(iSize)) (Low(iSize)) Set piButtonWidthMin To (Low(iSize) -5) Forward Get Msg_Add_Focus hoBase To iRetVal End_Procedure End_Object // oFindToolbar Set Border_Style To Border_None Get GuiSize To Windowindex Set GuiSize To (Hi(Windowindex) + 4) (Low(Windowindex) +5) Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Forward Send DoUpdateData iFromFile iToFile bFrom Set Enabled_State Of (oFindToolbar(Self)) To (iFromFile And iToFile) End_Procedure // DoUpdateData //AB-StoreEnd End_Object // oFindButton_c3d Object oDeleteValueTable_bn is a cBitmapButton Set Label to "D&elete Table" Set Size to 14 69 Set Location to 276 230 Set Status_Help to "Delete current Transformation Table" Set peAnchors to anBottomLeft Set Bitmap to "Delete16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Integer iRecord hoDD iRetval Move (SncTHea_DD(Self)) To hoDD Get Current_Record Of hoDD To iRecord If Not iRecord Begin Send Info_Box "No Value Transformation table to delete." Procedure_Return End // If Not iRecord Begin Get YesNo_Box "Are you sure you want to delete the current Value Transformation table?" To iRetval If (iRetval = MBR_NO) Procedure_Return Send Request_Delete Of SncTHea_DD // Will delete header and all rows Send DoCreateNewRecord Of SncTHea_DD // Init DDO's for creating a new record. Send Activate Of oFromField_cf // Do not stay in the grid. End_Procedure // OnClick //Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom // Integer iRecnum // Get Current_Record Of SncTHea_DD To iRecnum // Showln "doupdatedata iRecnum = " iRecnum // Set Enabled_State To iRecnum //End_Procedure // DoUpdateData //AB-StoreEnd End_Object // oDeleteValueTable_bn Object oInfoValue_tb is a cRDSTextbox Set Label to "An example of a conversion field value could be a source field that contains 'Y' or 'N' but the target field value needs to be a 0 or 1. One table can be used for each pair of selected fields." Set Auto_Size_State to FALSE Set Location to 70 364 Set Size to 44 169 Set Border_Style to Border_StaticEdge Set Justification_Mode to jMode_Left Set TypeFace to "MS Sans Serif" Set peAnchors to anTopRight //AB-StoreStart //Set Label_Shadow_Display_Mode To TBSHADOW_ON_LOCAL //AB-StoreEnd End_Object // oInfoValue_tb //AB-StoreStart Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Handle ho Move (oSncTRow_Grid(Self)) To ho Set Enabled_State To (iFromFile And iToFile) If (Enabled_State(Self)) Set Color Of ho To clWindow Else Set Color Of ho To clLtGray End_Procedure // DoUpdateData Procedure DoEnableDisable Integer iValue Handle ho Set Enabled_State To iValue Set Enabled_State Of oInfoValue_tb To iValue Set Enabled_State Of (Label_Object(oSnctable_FromdataTable_Conv(Self))) To iValue Set Enabled_State Of (Label_Object(oSnctable_Sncthea_Count(Self))) To iValue Set Enabled_State Of oNewValueTable_bn To iValue Set Enabled_State Of oDeleteValueTable_bn To iValue Move (oSncTRow_Grid(Self)) To ho If (Enabled_State(Self)) Set Color Of ho To clWindow Else Set Color Of ho To clLtGray End_Procedure // DoEnableDisable On_Key Key_Alt+Key_V Send KeyAction Of oViewFromData_bn On_Key Key_Alt+Key_D Send KeyAction Of oViewToData_bn On_Key Key_Alt+Key_N Send KeyAction Of oNewValueTable_bn On_Key Key_Alt+Key_E Send KeyAction Of oDeleteValueTable_bn On_Key Key_F8 Send OnClick Of (oNext_bn(oFindToolbar(oFindButton_c3d(Self)))) On_Key Key_F7 Send OnClick Of (oPrev_bn(oFindToolbar(oFindButton_c3d(Self)))) On_Key Key_Ctrl+Key_Home Send OnClick Of (oFirst_bn(oFindToolbar(oFindButton_c3d(Self)))) On_Key Key_Ctrl+Key_End Send OnClick Of (oLast_bn(oFindToolbar(oFindButton_c3d(Self)))) //AB-StoreEnd End_Object // oSncTRow_grp //AB-StoreStart //AB-StoreEnd End_Object // oDbTabPage6 Object oDbTabPage8 is a cRDSDbTabPage Set Label to "Mark Source Rows" Set Tab_ToolTip_Value to "Set field values for the source table records when a new Target record is created" Set piImageIndex to 10 Object oFlagField_grp is a cRDSDbGroup //AB-StoreTopStart Property String psFuncDateTxt "Today's Date" Property String psFuncDate "##1##" Property String psFuncTimeTxt "Current Time" Property String psFuncTime "##2##" Property String psFuncDateTimeTxt "Today's Date and Current Time" Property String psFuncDateTime "##3##" //AB-StoreTopEnd Set Size to 295 540 Set Location to 1 3 Set peAnchors to anAll Set Label to "Mark fields for the Source Table. When a source record is connected with a target record the selected source field value will be set." Object oFieldsMark_cf is a cDbFieldComboform Set Label to "Field/Column Number" Set Size to 13 150 Set Location to 25 78 Set Status_Help to "Available Fields/columns for the selected Source data table" Set Form_Border to 0 Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State to FALSE Set Combo_Sort_State to FALSE Set Code_Display_Mode to cb_Code_Display_Description Set pbFrom to TRUE //AB-StoreStart Procedure OnChange Handle hoList String sType sField Integer iLength iPrec iField iFile iType iOpen Move -1 To iType Get Value Item 0 To sField Get FileFieldNumber To iField // Class function. Move (Trim(sField)) To sField If (sField Contains "" Or sField = "") Begin Set Value Of oValueFunction_cf To "" Set Value Of oTypeMark_fm To "" Set Value Of oLengthMark_fm To "" Set Enabled_State Of oSelectMark_bn To False Procedure_Return End // If (sField Contains "" Or sField = "") Begin Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromFile To iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen If Not iOpen Procedure_Return Get_Attribute DF_FIELD_TYPE Of iFile iField To iType Get_Attribute DF_FIELD_LENGTH Of iFile iField To iLength Get_Attribute DF_FIELD_PRECISION Of iFile iField To iPrec If (iType = DF_BCD) Move (iLength - iPrec) To iLength Else Move 0 To iPrec Get_Attribute DF_FIELD_NAME Of iFile iField To sField Get UpperFirstChar sField To sField Get FieldType iType To sType Set Value Of oTypeMark_fm To sType Set Value Of oLengthMark_fm To (String(iLength) + "," + String(iPrec)) Move (oFlags_lst(Self)) To hoList Set psField Of hoList To sField Set piType Of hoList To iType Set piLength Of hoList To iLength Set Enabled_State Of oSelectMark_bn To True End_Procedure // OnChange // This is a dbComboform but not attached to a db field. // We kill these two procedures so the DDO doesn't get triggered: Procedure Set Changed_Value Integer iField String sValue End_Procedure Procedure Set Changed_State Boolean bState End_Procedure //AB-StoreEnd End_Object // oFieldsMark_cf Object oValueFunction_cf is a cRDSForm Set Label to "Value" Set Size to 13 119 Set Location to 25 330 Set Status_Help to "Enter a value to set the selected field/column to." Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Procedure OnChange Integer iItem String sValue Get Value Item 0 To sValue Move (Trim(sValue)) To sValue If (sValue = (psFuncDateTxt(Self))) Move (psFuncDate(Self)) To sValue // dbGroup properties. Else If (sValue = (psFuncTimeTxt(Self))) Move (psFuncTime(Self)) To sValue Else If (sValue = (psFuncDateTimeTxt(Self))) Move (psFuncDateTime(Self)) To sValue Set psValue Of oFlags_lst To sValue End_Procedure // OnChange Procedure Combo_Fill_List // Send Combo_Add_Item (psFuncDateTxt(Self)) // Send Combo_Add_Item (psFuncTimeTxt(Self)) // Send Combo_Add_Item (psFuncDateTimeTxt(Self)) End_Procedure // Combo_fill_list Procedure DoFillList Set Value To "" // Send Combo_Delete_Data // Send Combo_Fill_List End_Procedure // DoFillList //Function Next_Object_Id Returns Integer // Handle ho // Move (oDbTabPage8(oDbTables_TD(Self))) To ho // Function_Return ho //End_Function // Next_Object_Id //AB-StoreEnd End_Object // oValueFunction_cf Object oTypeMark_fm is a cRDSForm Set Label to "Field/Column Type" Set Size to 13 56 Set Location to 40 330 Set Status_Help to "The selected field/column type" Set Label_Col_Offset to 1 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //Set Label_Shadow_Display_Mode To TBSHADOW_ON_LOCAL Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Send Enable_Window Of (Label_Object(Self)) (iFromFile And iToFile) End_Procedure // DoUpdateData Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oTypeMark_fm Object oLengthMark_fm is a cRDSForm Set Label to "Length" Set Size to 13 33 Set Location to 40 416 Set Status_Help to "The selected field/column length and precision" Set Label_Col_Offset to 1 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //Set Label_Shadow_Display_Mode To TBSHADOW_ON_LOCAL Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Send Enable_Window Of (Label_Object(Self)) (iFromFile And iToFile) End_Procedure // DoUpdateData Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oLengthMark_fm Object oFlags_lst is a cRDSList //AB-StoreTopStart Property Integer piType -1 Property String psField "" Property String psValue "" Property Integer piLength 0 //AB-StoreTopEnd Set Label to "Selected Fields and Values" Set Size to 190 371 Set Location to 58 78 Set Status_Help to "List with Source data table fields that should be updated with specified values during a connection with a Target data table. Press Del or Ctrl+X to remove an item" Set peAnchors to anAll Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Top //AB-StoreStart Procedure DoAddToList Boolean bUpdate Integer iType iLength String sTable sField sValue sText sFlags Get piType To iType Get piLength To iLength Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.Fromdatatable To sTable Get StripExt sTable To sTable Get psField To sField Get psValue To sValue Move ("Source Row Field Value" * String(sTable) + "." + String(sField) + " = ") To sText If (sValue = psFuncDate(Self)) Get psFuncDateTxt To sFlags Else If (sValue = psFuncTime(Self)) Get psFuncTimeTxt To sFlags Else If (sValue = psFuncDateTime(Self)) Get psFuncDateTimeTxt To sFlags Else Move sValue To sFlags If (iType = DF_ASCII Or iType = DF_TEXT) Begin If (sValue = psFuncDate(Self) And iLength < 10) Begin Send Info_Box "The length of the field/column needs to be at least 10 characters for this function." If (iLength < 10) Procedure_Return End If (sValue = psFuncTime(Self) And iLength < 8) Begin Send Info_Box "The length of the field/column needs to be at least 8 characters for this function." Procedure_Return End If (sValue = psFuncDateTime(Self) And iLength < 19) Begin Send Info_Box "The length of the field/column needs to be at least 19 characters for this function." Procedure_Return End Move (sText * '"' + String(sFlags) + '"') To sText End // If (iType = DF_ASCII Or iType = DF_TEXT) Begin Else Begin If (iType <> DF_DATE And sValue = psFuncDate(Self)) Begin Send Info_Box "The selected function can only be applied to a field/column of type Ascii, Text or Date." Procedure_Return End // If (iType <> DF_DATE And sValue =psFuncDate(Self)) Begin Else If (sValue = psFuncDateTime(Self) Or sValue = psFuncDateTime(Self)) Begin Send Info_Box "The selected function can only be applied to a field/column of type Ascii." Procedure_Return End // Else If (sValue = psFuncTime(Self) Or sValue = psFuncDateTime(Self)) Begin If (Trim(sFlags) = "") Move 0 To sFlags Move (sText * String(sFlags)) To sText End // Else Begin Send Add_Item msg_None sText If bUpdate Send DoUpdateDDBuffer End_Procedure // DoAddToList Procedure DoDeleteItem Integer iItem Get Item_Count To iItem If Not iItem Procedure_Return Get Current_Item To iItem Send Delete_Item iItem Send DoUpdateDDBuffer End_Procedure // DoDeleteItem Procedure DoFillList Handle hoDD Boolean bTableChanged Integer iCount iFile iField iType iPos iFlags iOpen String sTable sField sFlags sMode sValue sText sSrc Set Dynamic_Update_State To False Send Delete_Data Delegate Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.SynchFlags To sFlags Move (Trim(sFlags)) To sFlags If (Length(sFlags) = 0) Begin Set Dynamic_Update_State To True Procedure_Return End // If (Length(sFlags) = 0) Begin Move (sFlags + "|") To sFlags // Format: "Field_Number|Mode|Value" Get Field_Current_Value Of hoDD Field SncTable.FromFile To iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen If Not iOpen Begin Set Dynamic_Update_State To True Procedure_Return End // If Not iOpen Begin // This will take care of a special situation. // The user has created a record and has also specified Selfields, he then changes the // datatable comboform to another table... Get Field_Changed_State Of hoDD Field SncTable.FromDataTable To bTableChanged If bTableChanged Begin // Reset DDO buffer value in case user saves the new config. Set Field_Changed_Value Of hoDD Field SncTable.SynchFlags To "" Set Dynamic_Update_State To True Procedure_Return End // If bTableChanged Begin Get Field_Current_Value Of hoDD Field SncTable.Fromdatatable To sTable Get StripExt sTable To sTable Get Field_Current_Value Of hoDD Field SncTable.SynchFlagCount To iFlags For iCount From 1 To iFlags Get ExtractValue sFlags " " To iField // Extract Field Value. (From SyncFuncs.pkg) Move (Replace((String(iField) + " "), sFlags, "")) To sFlags Get_Attribute DF_FIELD_NAME Of iFile iField To sField Get UpperFirstChar sField To sField Set psField To sField Get_Attribute DF_FIELD_TYPE Of iFile iField To iType Set piType To iType Get ExtractValue sFlags "|" To sValue Move (Replace((sValue + "|"), sFlags, "")) To sFlags If (sValue = psFuncDate(Self)) Move (psFuncDateTxt(Self)) To sValue Else If (sValue = psFuncTime(Self)) Move (psFuncTimeTxt(Self)) To sValue Else If (sValue = psFuncDateTime(Self)) Move (psFuncDateTime(Self)) To sValue Set psValue To sValue Send DoAddToList False Loop // For iCount from 1 to iConstr Set Dynamic_Update_State To True End_Procedure // DoFillList Procedure DoUpdateDDBuffer Handle hoDD Integer iCount iFile iField iPos iItems String sTable sField sFlags sValue sText sSrc sCurrent Delegate Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.FromFile To iFile Get Item_Count To iItems For iCount From 0 To (iItems - 1) Get Value Item iCount To sText Move (sText + " ") To sText Move (Pos(".", sText)) To iPos Move (Left(sText, iPos)) To sTable // Table: Move (Replace(sTable, sText, "")) To sText Get ExtractValue sText " " To sField // Function in SysFuncs.pkg Field_Map iFile sField To iField // Field: Move (Replace((sField + " "), sText, "")) To sText Move (Pos("=", sText)) To iPos Move (Right(sText, (Length(sText) - iPos))) To sText Move sText To sValue Move (Replace((sValue + " "), sText, "")) To sText Move (Replaces('"', sValue, '')) To sValue // Value Move (Trim(sValue)) To sValue If (sValue = psFuncDateTxt(Self)) Move (psFuncDate(Self)) To sValue Else If (sValue = psFuncTimeTxt(Self)) Move (psFuncTime(Self)) To sValue Else If (sValue = psFuncDateTimeTxt(Self)) Move (psFuncDateTime(Self)) To sValue Move (String(iField) * String(sValue)) To sText If (iCount < (iItems -1)) Move (sText + "|") To sText Move (sFlags + String(sText)) To sFlags Loop // For iCount from 1 to iConstr Get Field_Current_Value Of hoDD Field SncTable.SynchFlags To sText Move (Trim(sText)) To sText Get Field_Current_Value Of hoDD Field SncTable.SynchFlagCount To iCount If (sText <> sFlags) Begin // Showln "sText = " sText " sFlags = " sFlags Set Field_Changed_Value Of hoDD Field SncTable.SynchFlags To sFlags Set Field_Changed_Value Of hoDD Field SncTable.SynchFlagCount To iItems End // If (sText <> sFlags) Begin End_Procedure // DoUpdateDDBuffer Set Label_Shadow_Display_Mode To TBSHADOW_ON_LOCAL Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Send Enable_Window Of (Label_Object(Self)) (iFromFile And iToFile) End_Procedure // DoUpdateData On_Key kDelete_Character Send DoDeleteItem On_Key Key_Shift+Key_F2 Send DoDeleteItem On_Key Key_Ctrl+Key_X Send DoDeleteItem On_Key Key_F2 Send Request_Save Of (Main_DD(Self)) On_Key Key_Ctrl+Key_S Send Request_Save Of (Main_DD(Self)) //AB-StoreEnd End_Object // oFlags_lst Object oSnctable_Synchflagcount is a cRDSDbForm Entry_Item Snctable.Synchflagcount Set Label to "Number of Selected Fields" Set Size to 13 18 Set Location to 278 431 Set peAnchors to anBottomRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSnctable_Synchflagcount Object oSelectMark_bn is a cBitmapButton Set Label to "&Select" Set Size to 14 60 Set Location to 24 451 Set Status_Help to "Add the entered selection to the list below" Set Bitmap to "Ok16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Handle ho String sValue sField Integer iType iRetval Move (oFlags_lst(Self)) To ho Get piType Of ho To iType Get psValue Of ho To sValue Get psField Of ho To sField If (sField = "") Begin Send Info_Box "You need to select a field first." Procedure_Return End // If (sField = "") Begin Get psValue Of ho To sValue // If (sValue = (psFuncDate(Self)) Or sValue = (psFuncTime(Self)) Or sValue = (psFuncDateTime(Self))) Begin // Send Info_Box "Sorry, you can't use the entered value. It is reserved for an internal function name." // Procedure_Return // End // If (sValue = "" Or sValue = "" Or sValue = "") Begin If (iType = DF_DATE Or iType = DF_BCD) Begin Get IsNumeric sValue To iRetval If Not iRetval Begin Send Info_Box "Value should be numeric." Procedure_Return End // If Not iRetval Begin End // If (iType = DF_DATE Or iType = DF_BCD) Begin Send DoAddToList Of ho True // Send DoUpdateDDBuffer Of ho End_Procedure // OnClick Procedure DoEnableDisable Integer iValue String sTable sField Integer iFile iOpen Get psField Of oConstraints_lst To sField Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromFile To iFile Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromDataTable To sTable Move (Trim(sTable)) To sTable If iFile Get_Attribute DF_FILE_OPENED Of iFile To iOpen Set Enabled_State To (Length(sField) > 0 And Length(sTable) > 0 And iOpen) End_Procedure // DoEnableDisable Procedure DoCheckClear Send DoEnableDisable 0 End_Procedure // DoCheckClear // OLD CODE: //Procedure OnClick // Handle ho // String sValue // // Get Value Of oValueFunction_cf item 0 To sValue // Move (oFlags_lst(Self)) To ho // Get psValue Of ho To sValue // // If (sValue = (psFuncDate(Self)) Or sValue = (psFuncTime(Self)) Or sValue = (psFuncDateTime(Self))) Begin // // Send Info_Box "Sorry, you can't use the entered value. It is reserved for an internal function name." // // Procedure_Return // // End // If (sValue = "" Or sValue = "" Or sValue = "") Begin // Send DoAddToList Of ho True // // Set psField Of ho To "" // // Set piType Of ho To -1 // // Set piLength Of ho To 0 // // Get psValue Of ho To "" //End_Procedure // OnClick //AB-StoreEnd End_Object // oSelectMark_bn Object oViewFromData_bn is a cViewDataButton Set Label to "&View Data" Set Size to 14 60 Set Location to 40 451 Set Status_Help to "View data for the Source database table." Set Bitmap to "ViewData16.bmp" Set Enabled_State to FALSE Set piTransparentColor to clFuchsia Set pbFrom to TRUE //AB-StoreStart Procedure OnClick Integer iItem String sRetval Get FileFieldNumber Of oFieldsMark_cf To iItem // Class function. Get msg_DoViewData True iItem To sRetval If (Length(sRetval) > 0) Set Value Of oValueFunction_cf To sRetval End_Procedure // OnClick //AB-StoreEnd End_Object // oViewFromData_bn Object oSnctable_FromdataTable_Mark is a cRDSDbForm Entry_Item Snctable.Fromdatatable Set Label to "Source Table Name" Set Size to 13 150 Set Location to 10 78 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //Set Label_Shadow_Display_Mode To TBSHADOW_ON_LOCAL //Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom // Set Enabled_State Of (Label_Object(Self)) To (iFromFile And iToFile) // Send Enable_Window Of (Label_Object(Self)) (iFromFile And iToFile) //End_Procedure // DoUpdateData Procedure Set Enabled_State Boolean bState Forward Set Enabled_State To False End_Procedure // Set Enabled_State //AB-StoreEnd End_Object // oSnctable_FromdataTable_Mark //AB-StoreStart Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Handle ho String sTable Integer iOpen Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.Fromdatatable To sTable If iFromFile Get_Attribute DF_FILE_OPENED Of iFromFile To iOpen Set Enabled_State To (Length(sTable) > 0 And iOpen) Move (oFlags_lst(Self)) To ho If (Enabled_State(Self)) Set Color Of ho To clWindow Else Set Color Of ho To clLtGray Send DoFillList Of ho Set Enabled_State Of (Label_Object(oSnctable_FromdataTable_Mark)) To (Length(sTable) > 0 And iOpen) Set Enabled_State Of (Label_Object(oTypeMark_fm)) To (Length(sTable) > 0 And iOpen) Set Enabled_State Of (Label_Object(oLengthMark_fm)) To (Length(sTable) > 0 And iOpen) Set Enabled_State Of (Label_Object(oSnctable_Synchflagcount)) To (Length(sTable) > 0 And iOpen) End_Procedure // DoUpdateData On_Key Key_Alt+Key_S Send KeyAction Of oSelectMark_bn On_Key Key_Alt+Key_V Send KeyAction Of oViewFromData_bn //AB-StoreEnd End_Object // oFlagField_grp //AB-StoreStart //AB-StoreEnd End_Object // oDbTabPage8 Object oDbTabPage7 is a cRDSDbTabPage Set Label to "Other" Set Tab_ToolTip_Value to "Miscellaneous settings." Set piImageIndex to 11 Object oSnctable_Checkintegrity is a cRDSDbCheckBox Entry_Item Snctable.Checkintegrity Set Label to "Check For Database Table Layout Changes before Connecting Data" Set Size to 10 233 Set Location to 10 78 Set peAnchors to anTopLeft End_Object // oSnctable_Checkintegrity Object oSnctable_Notes is a cRDSDbEdit Entry_Item Snctable.Notes Set Label to "Notes" Set Size to 130 374 Set Location to 22 78 Set peAnchors to anAll Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right End_Object // oSnctable_Notes //AB-StoreStart Procedure DoUpdateData Integer iFromFile Integer iToFile Boolean bFrom Set Enabled_State Of oSnctable_Checkintegrity To (iFromFile And iToFile) Set Enabled_State Of oSnctable_Notes To (iFromFile And iToFile) End_Procedure // DoUpdateData //AB-StoreEnd End_Object // oDbTabPage7 //AB-StoreStart //On_Key Key_Alt+C Send OnClick Of oFromFileDSN_bn //On_Key Key_Alt+D Send OnClick Of oFromODBCAdmin_bn //On_Key Key_Alt+T Send OnClick Of oToFileDSN_bn //On_Key Key_Alt+B Send OnClick Of oToODBCAdmin_bn //AB-StoreEnd End_Object // oDbTables_TD //AB-StoreStart //On_Key Key_Alt+Key_W Send Popup Of oConnectDbWizard //Send DoStartWizard //AB-StoreEnd End_Object // oTable_tp Object oCollections_tb is a cRDSDbTabPage Set Label to "2. Collections of Database Connections" Set Tab_ToolTip_Value to "Create/Edit Collections of Database Connection records for the CrossMerge Engine." Set piImageIndex to 1 Object oCollections_grp is a cRDSDbGroup Set Size to 345 546 Set Location to 1 3 Set Label to "Collections" Object oInfo_tb is a cRDSTextbox Set Label to "The CrossMerge Engine can..." Set Auto_Size_State to FALSE Set Location to 13 7 Set Size to 18 533 Set Border_Style to Border_StaticEdge Set Justification_Mode to jMode_Left Set TypeFace to "MS Sans Serif" //AB-StoreStart Procedure OnStartUp String sText Move "The CrossMerge Engine can be started with a Collection Name as a parameter on the command line. This is very useful when Windows Scheduled tasks is used to start the Engine at a predefined time." To sText Move (sText * "A default Collection Name can be set on the 'CrossMerge Engine' tab-page.") To sText Set Label To sText End_Procedure // OnStartUp Send OnStartUp //AB-StoreEnd End_Object // oInfo_tb Object oSncSchem_grd is a cSyncTableCheckBoxGrid Set Size to 289 454 Set Location to 33 7 Set Highlight_Row_state to TRUE Set peAnchors to anAll Set peResizeColumn to rcAll Set piResizeColumn to 2 Set phoDD to (SncTable_DD(Self)) Set Line_Width to 4 0 Set Form_Width item 0 to 37 Set Header_Label item 0 to "Selected" Set Form_Width item 1 to 50 Set Header_Label item 1 to "Sort Name" Set Form_Width item 2 to 315 Set Header_Label item 2 to "Database Connection Record (Description)" Set Form_Width item 3 to 46 Set Header_Label item 3 to "Auto Delete" //AB-StoreStart Set pbSynchSetup To True Set psToolTipTitle To "Collections" Set psToolTip To "Select the connection records that should belong to the named or selected collection name in the combo below, and press the 'Save' button." Procedure Select_Toggling Integer iItem Integer bState Handle hoDD Forward Send Select_Toggling iItem bState Move (SncSchem_DD(Self)) To hoDD // Do this to trigger a change in this DDO to auto save before // the Engine is started. //Set Field_Changed_Value Of hoDD Field SncSchem.Workspace To sValue Set Changed_State Of hoDD To True End_Procedure // Select_Toggling //AB-StoreEnd End_Object // oSncSchem_grd Object oSncSchem_cb is a cRDSComboForm Set Label to "Collection Name" Set Size to 13 220 Set Location to 326 66 Set Status_Help to "Create a new Collection Name; 1. Press the Clear button 2. Select items from the grid 3. Enter a descriptive Name 4. Press Save" Set peAnchors to anBottomLeft Set Form_Border to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Procedure Combo_Fill_List Send Combo_Delete_Data Clear SncSchem Find Gt SncSchem by Index.1 While (Found) Send Combo_Add_Item (Trim(SncSchem.Name)) Find Gt SncSchem by Index.1 Loop // While (Found) Clear SncSchem End_Procedure // Combo_fill_list Procedure OnCloseUp Integer iItem String sValue Handle hoDD Forward Send OnCloseUp Send StartWorkingMessage "Displaying Collection..." Get WinCombo_Current_Item To iItem Get WinCombo_Value Item iItem To sValue Send DoFillGrid Of oSncSchem_grd Send DoDisplayScheme Of oSncSchem_grd sValue Send StopWorkingMessage Move (SncSchem_DD(Self)) To hoDD // Move (Random(10000000)) To sValue // Set Field_Changed_Value Of hoDD Field SncSchem.Workspace To sValue Set Changed_State Of hoDD To True End_Procedure // OnCloseUp // Display default Collection Name on program startup. Procedure OnStartup Clear SncSchem Move SncSys.Default_Scheme To SncSchem.Name Find Eq SncSchem by Index.1 If (Found) Set Value Item 0 To (Trim(SncSchem.Name)) Clear SncSchem End_Procedure // OnStartup Send OnStartup //On_Key Key_Alt+Key_S Send KeyAction Of oSave_bn //On_Key Key_F2 Send KeyAction Of oSave_bn //AB-StoreEnd End_Object // oSncSchem_cb Object oSelectAll_bn is a cBitmapButton Set Label to "Select &All" Set Size to 14 80 Set Location to 44 463 Set Status_Help to "Select all items in the grid" Set peAnchors to anTopRight Set Bitmap to "SelectAll16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Send DoToggleAll Of oSncSchem_grd 1 End_Procedure // OnClick //AB-StoreEnd End_Object // oSelectAll_bn Object oDeselectAll_bn is a cBitmapButton Set Label to "Select &None" Set Size to 14 80 Set Location to 60 463 Set Status_Help to "De-select all items in the grid" Set peAnchors to anTopRight Set Bitmap to "SelectNone16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Send DoToggleAll Of oSncSchem_grd 0 End_Procedure // OnClick //AB-StoreEnd End_Object // oDeselectAll_bn Object oInvertSelection_bn is a cBitmapButton Set Label to "&Invert Selection" Set Size to 14 80 Set Location to 76 463 Set Status_Help to "Invert the selection order" Set peAnchors to anTopRight Set Bitmap to "SelectInvert16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Send DoToggleAll Of oSncSchem_grd -1 End_Procedure // OnClick //AB-StoreEnd End_Object // oInvertSelection_bn Object oSave_bn is a cBitmapButton Set Label to "&Save" Set Size to 14 54 Set Location to 326 291 Set Status_Help to "Save the entered Collection Name and it's grid selections" Set peAnchors to anBottomLeft Set Bitmap to "Save16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Handle hoGrid hoSncSchem_cb hoDD String sSncTables sName Integer iRetval Move (oSncSchem_grd(Self)) To hoGrid Move (oSncSchem_cb(Self)) To hoSncSchem_cb Move (SncSchem_DD(Self)) To hoDD Get SelectedItems Of hoGrid To sSncTables Get Value Of hoSncSchem_cb Item 0 To sName Move (Trim(sName)) To sName If (Length(sName) > 0) Begin Send Clear Of hoDD Move sName To SncSchem.Name Send Find Of hoDD Eq Index.1 If Not (Found) Send Clear Of hoDD End // If (Length(sName) > 0) Begin Set File_Field_Changed_Value Of hoDD File_Field SncSchem.Name To sName Set File_Field_Changed_Value Of hoDD File_Field SncSchem.Tables To sSncTables Get Request_Validate Of hoDD To iRetval If (iRetval <> 0) Procedure_Return Send Request_Save Of hoDD Send Combo_Fill_List Of hoSncSchem_cb // Refill combo with new data. Send Combo_Fill_List Of oDefaultSchemeName_cf // On Default synch. settings tab-page. Set Value Of hoSncSchem_cb Item 0 To sName End_Procedure // OnClick //AB-StoreEnd End_Object // oSave_bn Object oClear_bn is a cBitmapButton Set Label to "New/&Clear" Set Size to 14 60 Set Location to 326 347 Set Status_Help to "Clear selections and Collection name to create a new Collection Name" Set peAnchors to anBottomLeft Set Bitmap to "New16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Send DoToggleAll Of oSncSchem_grd (False) Set Value Of oSncSchem_cb Item 0 To "" End_Procedure // OnClick //AB-StoreEnd End_Object // oClear_bn Object oDelete_bn is a cBitmapButton Set Label to "&Delete" Set Size to 14 54 Set Location to 326 408 Set Status_Help to "Delete the selected Collection Name and it's grid selections" Set peAnchors to anBottomLeft Set Bitmap to "Delete16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Integer hoDD ho String sValue Move (SncSchem_DD(Self)) To hoDD Move (oSncSchem_cb(Self)) To ho Get Value Of ho Item 0 To sValue Send Request_Clear Of hoDD Move (Trim(sValue)) To SncSchem.Name Send Find Of hoDD Eq Index.1 If (Found) Begin Send Request_Delete Of hoDD Send Combo_Fill_List Of ho Send DoDisplayScheme Of oSncSchem_grd "" End // If (Found) Begin End_Procedure // OnClick //AB-StoreEnd End_Object // oDelete_bn End_Object // oCollections_grp //AB-StoreStart On_Key Key_Alt+Key_A Send KeyAction Of oSelectAll_bn On_Key Key_Alt+Key_N Send KeyAction Of oDeselectAll_bn On_Key Key_Alt+Key_I Send KeyAction Of oInvertSelection_bn On_Key Key_Alt+Key_S Send KeyAction Of oSave_bn On_Key Key_F2 Send KeyAction Of oSave_bn On_Key Key_Alt+Key_C Send KeyAction Of oClear_bn On_Key Key_F5 Send KeyAction Of oClear_bn On_Key Key_Alt+Key_D Send KeyAction Of oDelete_bn On_Key Key_Shift+Key_F2 Send KeyAction Of oDelete_bn //AB-StoreEnd End_Object // oCollections_tb Object oRun_TP is a cRDSDbTabPage Set Label to "3. CrossMerge Engine" Set Tab_ToolTip_Value to "Set up defaults for and schedule when to run the CrossMerge Engine." Set piImageIndex to 2 Object oGlobal_grp is a cRDSDbGroup //AB-StoreTopStart Property String psWarning "WARNING!\n If you un-check this choice, there will be no way of cancelling the synchronize process until it has finished." //AB-StoreTopEnd Set Size to 116 546 Set Location to 1 3 Set peAnchors to anTopLeftRight Set Label to "Default CrossMerge Engine Settings" Object oDefaultSchemeName_cf is a cRDSComboForm //AB-StoreTopStart Property Boolean pbFirst True //AB-StoreTopEnd Set Label to "Default Collection" Set Size to 13 200 Set Location to 10 78 Set Status_Help to "Use this default Collection Name for the CrossMerge Engine program" Set Form_Border to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Entry_State Item 0 to FALSE Set Combo_Sort_State to FALSE //AB-StoreStart Set Entry_State Item 0 To False // Combo_Fill_List is called when the list needs filling Procedure Combo_Fill_List Handle hoDD Move (SncSchem_DD(Self)) To hoDD Send Combo_Delete_Data Send Combo_Add_Item " " Send Clear Of hoDD Send Find Of hoDD First_Record Index.1 While (Found) Send Combo_Add_Item (Trim(SncSchem.Name)) Send Find Of hoDD Next_Record Index.1 Loop Send Clear Of hoDD Set Value Item 0 To (Trim(SncSys.Default_Scheme)) End_Procedure // Combo_fill_list // We may need to refresh the list if new records // have been created with the Scheme program. Procedure OnDropDOwn Send Combo_Fill_List End_Procedure // Notification of a selection change. Procedure OnChange Handle hoDD Integer iItem String sValue If (pbFirst(Self)) Begin // Do not set Enabled_State of oApply_bn on program startup. Set pbFirst To False Procedure_Return End // If (pbFirst(Self)) Begin Move (SncSys_DD(Self)) To hoDD Get WinCombo_Current_Item To iItem Get WinCombo_Value Item iItem To sValue If (Trim(SncSys.Default_Scheme) <> Trim(sValue)) Begin Set Field_Changed_Value Of hoDD Field SncSys.Default_Scheme To sValue Set Enabled_State Of oApply_bn To True End End_Procedure // OnCloseUp //AB-StoreEnd End_Object // oDefaultSchemeName_cf Object oSncsys_Dsn_Names is a cRDSDbForm Entry_Item Sncsys.Dsn_names Set Server to Sncsys_DD Set Label to "Check ODBC DSN's" Set Size to 13 432 Set Location to 25 78 Set peAnchors to anLeftRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart //Set Status_Help To "Check that these ODBC DSN's (Data Source Name) exist when the CrossMerge Engine program is starting" Procedure OnChange Boolean bState Get Changed_State Of (SncSys_DD(Self)) To bState Set Enabled_State Of oApply_bn To bState End_Procedure // OnCloseUp //AB-StoreEnd End_Object // oSncsys_Dsn_Names Object oSncsys_Allowtblchange is a cSysDbCheckBox Entry_Item Sncsys.Allowtblchange Set Server to Sncsys_DD Set Label to "Allow user to change selections of Database Table items (left checkbox column)" Set Size to 10 268 Set Location to 40 78 End_Object // oSncsys_Allowtblchange Object oSncsys_Allowautodelete is a cSysDbCheckBox Entry_Item Sncsys.Allowautodelete Set Server to Sncsys_DD Set Label to "Allow user to change ' Auto Delete' (right checkbox column)" Set Size to 10 204 Set Location to 52 78 End_Object // oSncsys_Allowautodelete Object oSncsys_Show_Info is a cSysDbCheckBox Entry_Item Sncsys.Show_info Set Server to Sncsys_DD Set Label to "Display status panel with info while CrossMerge Engine is running" Set Size to 10 221 Set Location to 64 78 //AB-StoreStart Procedure Select_Toggling Integer iItem Integer bState Forward Send Select_Toggling iItem bState Get Select_State Item 0 To bState If Not bState Send Info_Box (psWarning(Self)) // Group property Set Enabled_State Of oSncSys_AllowCancelSent To bState End_Procedure //AB-StoreEnd End_Object // oSncsys_Show_Info Object oSncsys_Allowcancelsent is a cSysDbCheckBox Entry_Item Sncsys.Allowcancelsent Set Server to Sncsys_DD Set Label to "Allow to cancel running of the CrossMerge Engine" Set Size to 10 173 Set Location to 76 78 //AB-StoreStart Set Enabled_State To SncSys.Show_Info Procedure Select_Toggling Integer iItem Integer bState Forward Send Select_Toggling iItem bState Get Select_State Item 0 To bState If Not bState Send Info_Box (psWarning(Self)) // Group property End_Procedure //AB-StoreEnd End_Object // oSncsys_Allowcancelsent Object oSncsys_Allowdeletelog is a cSysDbCheckBox Entry_Item Sncsys.Allowdeletelog Set Server to Sncsys_DD Set Label to "Allow delete of the connection log" Set Size to 10 123 Set Location to 88 78 End_Object // oSncsys_Allowdeletelog Object oSncsys_Runminimized is a cSysDbCheckBox Entry_Item Sncsys.Runminimized Set Server to Sncsys_DD Set Label to "Run Program Minimized when scheduled to Autorun" Set Size to 10 179 Set Location to 100 78 End_Object // oSncsys_Runminimized Object oApply_bn is a cBitmapButton Set Label to "&Apply" Set Size to 14 50 Set Location to 95 480 Set Status_Help to "Apply/Save changes" Set peAnchors to anBottomRight Set Bitmap to "Ok16.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Set Enabled_State To False Procedure OnClick Handle hoDD Boolean bChanged Move (SncSys_DD(Self)) To hoDD Get Changed_State Of hoDD To bChanged If Not bChanged Procedure_Return Send Request_Save Of hoDD Set Enabled_State To False End_Procedure // OnClick //AB-StoreEnd End_Object // oApply_bn //AB-StoreStart On_Key Key_F2 Send KeyAction Of oApply_bn On_Key Key_Alt+Key_A Send KeyAction Of oApply_bn On_Key Key_Ctrl+Key_S Send KeyAction Of oApply_bn //AB-StoreEnd End_Object // oGlobal_grp Object oProgramStart_grp is a cRDSDbGroup Set Size to 100 546 Set Location to 122 3 Set peAnchors to anTopLeftRight Set Label to "Start Programs" Object oScheduledTasksHelp_Bn is a cBitmapButton Set Label to "Help on how to Create a Win&dows Scheduled Task" Set Size to 25 219 Set Location to 11 98 Set Status_Help to "Display Help on how to Auto Start the CrossMerge Engine program with Windows Scheduled tasks." Set Help_Id to WinScheduledTask Set Bitmap to "Help32.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick //String sTarget sPath // Move "MStask.chm" To sTarget // Get_Windows_Directory To sPath // Send DoStartDocument "Open" sTarget "" (sPath - "\Help") // Move (psHelpPath(phoWorkspace(ghoApplication))) To sPath // Send DoStartDocument "open" "CmBuilder.chm" "" sPath Send DoShowMapID Of ghoHtmlHelp WinScheduledTask End_Procedure // OnClick //AB-StoreEnd End_Object // oScheduledTasksHelp_Bn Object oScheduledTasks_bn is a cBitmapButton Set Label to "Start Windows Scheduled &Tasks" Set Size to 25 219 Set Location to 40 98 Set Status_Help to "Create a scheduled activity to automatically run the CrossMerge Engine program" Set Bitmap to "SchedTask32.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart //Procedure OnClick // String sTarget sParams sPath // Move "Explorer.exe" To sTarget // Move "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\::{D6277990-4C6A-11CF-8D87-00AA0060F5BF}" ; // To sParams // Move "%HOMEDRIVE%%HOMEPATH%" To sPath // Send DoStartDocument "Open" sTarget sParams "" sPath //End_Procedure // OnClick Procedure OnClick Handle hoPanel Get Create U_cControlPanel To hoPanel If (hoPanel <> 0) Begin Send OpenScheduledTasks Of hoPanel Send Destroy Of hoPanel End // If (hoPanel <> 0) Begin End_Procedure // OnClick //AB-StoreEnd End_Object // oScheduledTasks_bn Object oSynchronizeProgram_bn is a cBitmapButton Set Label to "Start the CrossMerge &Engine" Set Size to 25 219 Set Location to 69 98 Set Status_Help to "Start the CrossMerge Engine program manually to synchronize data." Set Bitmap to "CmEngine32.bmp" Set piTransparentColor to clFuchsia //AB-StoreStart Procedure OnClick Boolean bSave String sPath Integer iRetval Get Should_Save Of (Main_DD(Self)) To bSave If (bSave = False) Get Should_Save Of (SncSys_DD(Self)) To bSave If (bSave = False) Get Should_Save Of (SncSchem_DD(Self)) To bSave If (bSave = True) Begin Get YesNo_Box "Changes exist. Save them first?" To iRetval If (iRetval = Mbr_Yes) Send Request_Save End // If (bSave = True) Begin Move (psProgramPath(phoWorkspace(ghoApplication))) To sPath // Send DoStartDocument "open" (sPath - "\CMEngine.exe") C_RDCENC sPath Send DoStartDocument "open" (sPath - "\CMEngine.exe") "" "" End_Procedure // OnClick //AB-StoreEnd End_Object // oSynchronizeProgram_bn Object oDummy_fm is a cRDSForm Set Size to 13 2 Set Location to 150 444 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart //Procedure OnChange // String sValue // Get value to sValue // //End_Procedure // OnChange //AB-StoreEnd End_Object // oDummy_fm End_Object // oProgramStart_grp //AB-StoreStart On_Key Key_Alt+Key_D Send KeyAction Of oScheduledTasksHelp_Bn On_Key Key_Alt+Key_T Send KeyAction Of oScheduledTasks_bn On_Key Key_Alt+Key_E Send KeyAction Of oSynchronizeProgram_bn //AB-StoreEnd End_Object // oRun_TP Object oLog_tp is a cRDSDbTabPage Set Label to "4. View Log" Set Tab_ToolTip_Value to "View Log records created by the CrossMerge Engine" Set piImageIndex to 3 Object oSncLog_grd is a cRDSDbList //AB-StoreTopStart Set Entry_msg To DoDisableToolbarButtons Set Exit_msg To DoEnableToolbarButtons //AB-StoreTopEnd Set Main_File to Snclog.File_Number Set Server to Snclog_DD Set Ordering to 1 Set Size to 258 544 Set Location to 4 4 Set peDisabledTextColor to clWindowText Set peAnchors to anAll Set peResizeColumn to rcSelectedColumn Set piResizeColumn to 2 Set pbHeaderTogglesDirection to TRUE Set pbReverseOrdering to TRUE Set Auto_Column_State to FALSE Set Move_Value_Out_State to FALSE Begin_Row Entry_Item Snclog.Recid Entry_Item (Snclog.Recid) Entry_Item Snclog.Statustext Entry_Item Snclog.Tablename Entry_Item Snclog.Datetime Entry_Item Snclog.Networkusername End_Row Set Form_Width item 0 to 30 Set Header_Label item 0 to "Log ID" Set Form_Width item 1 to 29 Set Header_Label item 1 to "Status" Set Form_Width item 2 to 189 Set Header_Label item 2 to "Status Text" Set Form_Width item 3 to 170 Set Header_Label item 3 to "Database Connection" Set Form_Width item 4 to 72 Set Header_Label item 4 to "Date and Time" Set Form_Width item 5 to 49 Set Header_Label item 5 to "User Name" //AB-StoreStart Set Popup_State To False Set psToolTipTitle To "Connection Log" Set psToolTip To "Each activity by the CrossMerge Engine is logged automatically to a log file. The latest entry is shown at the top of the list. For details about a selected log record, see the bottom part." Procedure Entry_Display Integer iFile Integer iType Integer iBase_Item iItem String sValue Forward Send Entry_Display iFile iType Get Base_Item To iBase_Item If (iBase_Item < 0) Procedure_Return Increment iBase_Item Set Value Item iBase_Item To "" Get Value Item (iBase_Item + 1) To sValue If (Uppercase(sValue) Contains "ERROR") ; Set Form_Bitmap Item iBase_Item To "Error.bmp/t" Else If (Uppercase(sValue) Contains "WARNING") ; Set Form_Bitmap Item iBase_Item To "Warning.bmp/t" Else ; Set Form_Bitmap Item iBase_Item To "Info.bmp/t" End_Procedure // Entry_Display // Do this when reordering so the first column doesn't always take the focus: //Procedure OnBeginningofPanel // Send DoMakeColumnVisible 0 //End_Procedure Procedure DoEnableToolbarButtons Handle ho Move (oToolBar(Self)) To ho If ho Begin Get phoCut To ho If ho Set pbEnabled Of ho To True Get phoCopy To ho If ho Set pbEnabled Of ho To True Get phoPaste To ho If ho Set pbEnabled Of ho To True End // If ho Begin End_Procedure // DoEnableToolbarButtons Procedure DoDisableToolbarButtons Handle ho Move (oToolBar(Self)) To ho If ho Begin Get phoCut To ho If ho Set pbEnabled Of ho To False Get phoCopy To ho If ho Set pbEnabled Of ho To False Get phoPaste To ho If ho Set pbEnabled Of ho To False End // If ho Begin End_Procedure // DoDisableToolbarButtons Procedure DoDeleteRecord Integer iRow Get Current_Row To iRow Set Dynamic_Update_State To False Send Request_Delete Of SncLog_DD If (iRow = 0) Send Beginning_Of_Data Else Begin Send Up_Row Send Refresh_Page iRow 0 End // Else Begin Set Dynamic_Update_State To True Send DoSetRecordCount Of oCurrentRecords_fm End_Procedure // DoDeleteRecord On_Key Key_Ctrl+Key_X Send DoDeleteRecord On_Key kDelete_Record Send DoDeleteRecord On_Key kEnter Send msg_None //AB-StoreEnd End_Object // oSncLog_grd Object oSnclog_Statustext is a cRDSDbEdit Entry_Item Snclog.Statustext Set Server to Snclog_DD Set Label to "Status Text" Set Size to 33 471 Set Location to 266 78 Set peAnchors to anBottomLeftRight Set Label_Row_Offset to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //AB-StoreEnd End_Object // oSnclog_Statustext Object oSnclog_Tablename is a cRDSDbForm Entry_Item Snclog.Tablename Set Server to Snclog_DD Set Label to "Database Connection" Set Size to 13 471 Set Location to 301 78 Set peAnchors to anBottomLeftRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //AB-StoreEnd End_Object // oSnclog_Tablename Object oSnclog_Datetime is a cRDSDbForm Entry_Item Snclog.Datetime Set Server to Snclog_DD Set Label to "Date and Time" Set Size to 13 75 Set Location to 316 78 Set peAnchors to anBottomLeft Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //AB-StoreEnd End_Object // oSnclog_Datetime Object oSnclog_Networkusername is a cRDSDbForm Entry_Item Snclog.Networkusername Set Server to Snclog_DD Set Label to "User Name" Set Size to 13 95 Set Location to 316 198 Set peAnchors to anBottomLeft Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Enabled_State To False //AB-StoreEnd End_Object // oSnclog_Networkusername Object oCurrentRecords_fm is a cRDSForm Set Label to "Number of Log Records" Set Size to 13 43 Set Location to 316 393 Set Status_Help to "Current number of Log records." Set peAnchors to anBottomRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Form_Datatype Item 0 To Mask_Numeric_Window Set Form_Mask Item 0 To "#,###########" Set Enabled_State To False Procedure DoSetRecordCount Integer iRecords Get_Attribute DF_FILE_RECORDS_USED Of SncLog.File_Number To iRecords Set Value Item 0 To iRecords End_Procedure // DoSetRecordCount Send DoSetRecordCount //AB-StoreEnd End_Object // oCurrentRecords_fm Object oMaxRecords_fm is a cRDSForm Set Label to "Max no of Records" Set Size to 13 43 Set Location to 316 506 Set Status_Help to "Maximum number of records the log can contain." Set peAnchors to anBottomRight Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Form_Datatype Item 0 To Mask_Numeric_Window Set Form_Mask Item 0 To "#,###########" Set Enabled_State To False Procedure DoSetRecordCount Integer iRecords Get_Attribute DF_FILE_MAX_RECORDS Of SncLog.File_Number To iRecords Set Value Item 0 To iRecords End_Procedure // DoSetRecordCount Send DoSetRecordCount //AB-StoreEnd End_Object // oMaxRecords_fm Object oDeleteLog_bn is a cZeroLogBn Set Label to "&Delete Log" Set Size to 14 63 Set Location to 332 486 Set Status_Help to "Press to delete all records in the log." Set peAnchors to anBottomRight Set Bitmap to "Delete16.bmp" End_Object // oDeleteLog_bn //AB-StoreStart Set Popup_State To False On_Key Key_Alt+Key_D Send KeyAction Of oDeleteLog_bn //AB-StoreEnd End_Object // oLog_tp //AB-StoreStart Set piMinSize To 343 558 Set Popup_State To False Procedure Request_Switch_To_Tab Integer iPageNumber Integer iMode Handle hoDD ho Integer iRecnum // Collection tab page: If (iPageNumber = 1) Begin Send DoInitGrid Of oSncSchem_grd Send OnStartup Of oSncSchem_cb End // If (iPageNumber = 1) Begin // Tell sysfile DDO to reread on tab page changes. // Needed if changes have been made in other programs: Else If (iPageNumber = 2) Begin Move (SncSys_DD(Self)) To hoDD If hoDD Begin Get Field_Current_Value Of hoDD Field SncSys.Recnum To iRecnum Send Find_By_Recnum Of hoDD SncSys.File_Number iRecnum End Else End // If (iPageNumber = 2) Begin Else If (iPageNumber = 3) Begin Move (oSncLog_grd(oLog_tp(Self))) To ho If ho Begin Send Beginning_Of_Data Of ho Broadcast Recursive Send DoSetRecordCount // Will update SncLog counter fields. End // If ho Begin End // Else If (iPageNumber = 3) Begin Forward Send Request_Switch_To_Tab iPageNumber iMode End_Procedure // Request_Switch_To_Tab //AB-StoreEnd End_Object // oRDS_td //AB-StoreStart Set phoSDIView Of ghoApplication To Self Set peAnchors To anAll // This needs to be manually set in VDF9.1 -> //Get GuiSize To Windowindex Procedure DoSave Handle hoDD Get Main_DD To hoDD Send Request_Save End_Procedure Procedure Request_Save Boolean bSave Forward Send Request_Save Get Should_Save Of (SncSys_DD(Self)) To bSave If (bSave = True) Send Request_Save Of (Sncsys_DD(Self)) Get Should_Save Of (SncSchem_DD(Self)) To bSave If (bSave = True) Send KeyAction Of (oSave_bn(oCollections_tb(oRDS_td(Self)))) End_Procedure // Request_Save Procedure Request_Clear Forward Send Request_Clear Send Activate Of oSnctable_Recid End_Procedure // Request_Clear Function DisplayDeleteWaring Returns Boolean String sText Integer iRetval Move "If you delete a record that has been included in a Collection name it will 'mess up' the Collection data for selected Table Setup records." To sText Move (sText * "If you do, you might need to edit selections for each Collection name .") To sText Move (sText + "\n\nActually, the last selected record for each Collection name will be removed automatically.") To sText Move (sText + "\nNote: If this is the last record for a Collection name the Collection record itself will be deleted.\n\nContinue to Delete Record?") To sText Get YesNo_Box sText "Delete question" To iRetval Function_Return (iRetval <> MBR_YES) End_Function // DisplayDeleteWaring Set Verify_Delete_msg To get_DisplayDeleteWaring Set Verify_Save_msg To msg_None // Do not allow to close panel: Procedure Request_Cancel End_Procedure // Request_Cancel Procedure CancelWizard // This is needed by the cdbComboFormat & cdbComboDriver classes. End_Procedure // CancelWizard Function RdsMain_Panel_Id Returns Integer Function_Return Self End_Function Procedure DoStartWizard //Send Popup Of (oConnectDbWizard(Self)) End_Procedure // DoStartWizard Procedure DoStartEngine String sPath // Send DoStartDocument "open" "CmEngine.exe" C_RDCENC (psProgramPath(phoWorkspace(ghoApplication))) Move (psProgramPath(phoWorkspace(ghoApplication))) To sPath Send DoStartDocument "open" (sPath - "\CMEngine.exe") "" "" End_Procedure // DoStartEngine Procedure DoHelp // Send DoStartDocument "open" (psHelpFile(ghoApplication)) "" (psHelpPath(phoWorkspace(ghoApplication))) Send DoShowMapID Of ghoHtmlHelp GeneralHelpId End_Procedure // DoHelp Function Item_Count Returns Integer End_Function // Status_Help On_Key Key_Ctrl+Key_S Send DoSave On_Key Key_F1 Send DoHelp On_Key Key_Alt+Key_H Send DoHelp On_Key Key_Alt+Key_P Send DoPopupProperties //Popup Of oProperties_dg //On_Key Key_Alt+Key_W Send DoStartWizard On_Key Key_Alt+Key_E Send DoStartEngine On_Key Key_Alt+Key_B Send Activate_About //AB-StoreEnd End_Object // oRdcView //AB-StoreStart //AB-StoreEnd //AB/ End_Object // oIDE_Project