//AB/ Project Import Text //AB/ Object prj is a Dialog_Project //AB/ Set ProjectName to "Import Text" //AB/ Set ProjectFileName to "dbImport.DG" // Project Object Structure // dbImportWizard is a cWizard // oFieldArray is a Array // oWelcomePage is a cWelcomePage // oSelectWorkspacePage is a cInteriorPage // oWorkspaceKeyArray is a Array // oNonSelectedTb is a Textbox // oWorkSpaceList is a cList // oSelectTablePage is a cInteriorPage // oTableTb is a cTextbox // oTableList is a cList // oSelectFieldPage is a cInteriorPage // oExact_Match is a CheckBox // oTextBox1 is a Textbox // oFieldList is a cList // oRefresh_Btn is a Button // oAdd_Btn is a Button // oRemove_Btn is a Button // oTextBox2 is a Textbox // oSelectedFieldList is a cList // oImportFileType is a cInteriorPage // oInstructionsText is a cTextbox // oFileTypeRadioGrp is a RadioGroup // oRadio1 is a Radio // oRadio2 is a Radio // oRadio3 is a Radio // oZeroFileCheckBox is a CheckBox // oHeaderRowCheckbox is a CheckBox // oHexCheckbox is a CheckBox // oLineControl2 is a LineControl // oDelimitCombo is a ComboForm // oOtherDelimiter is a Form // oImportFileName is a Form // oImportOrCode is a cInteriorPage // oInstructionsText is a cTextbox (Duplicate object name) // oImportOrCodeRadioGrp is a RadioGroup // oRadio1 is a Radio (Duplicate object name) // oRadio2 is a Radio (Duplicate object name) // oIDECheckbox is a CheckBox // oSummaryPage is a cInteriorPage // oSummaryWarningTb is a Textbox // oSummaryEdit is a Edit // oCompletionPage is a cCompletionPage // Register all objects Register_Object dbImportWizard Register_Object oAdd_Btn Register_Object oCompletionPage Register_Object oDelimitCombo Register_Object oExact_Match Register_Object oFieldArray Register_Object oFieldList Register_Object oFileTypeRadioGrp Register_Object oHeaderRowCheckbox Register_Object oHexCheckbox Register_Object oIDECheckbox Register_Object oImportFileName Register_Object oImportFileType Register_Object oImportOrCode Register_Object oImportOrCodeRadioGrp Register_Object oInstructionsText Register_Object oLineControl2 Register_Object oNonSelectedTb Register_Object oOtherDelimiter Register_Object oRadio1 Register_Object oRadio2 Register_Object oRadio3 Register_Object oRefresh_Btn Register_Object oRemove_Btn Register_Object oSelectedFieldList Register_Object oSelectFieldPage Register_Object oSelectTablePage Register_Object oSelectWorkspacePage Register_Object oSummaryEdit Register_Object oSummaryPage Register_Object oSummaryWarningTb Register_Object oTableList Register_Object oTableTb Register_Object oTextBox1 Register_Object oTextBox2 Register_Object oWelcomePage Register_Object oWorkSpaceList Register_Object oWorkspaceKeyArray Register_Object oZeroFileCheckBox //AB-StoreTopStart Integer giIn_VDF12orLater Use Windows.Pkg // DAW package Use cList.pkg // Specialized list class from DAW Examples Use DFPanel.pkg // DAW package Use dbImportWorkspace.pkg // Create the workspace object Use BatchDD.pkg #IF (FMAC_VERSION < |CI12) Move 0 to giIn_VDF12orLater Use cIniFile // DAW package #ELSE Move 1 to giIn_VDF12orLater Object oRegistry is a cRegistry End_Object #ENDIF Register_Function DEO_Object returns integer Use cToolbar.pkg // DAW package Use cToolbarButton.pkg // DAW package Use cImageList.pkg // DAW package Use BrowseForFolder.pkg // Package for selection of folders Use vWin32fh.pkg // vdf-Guidance Windows API functions Use WinFileSize.pkg // Physical size of a file Use CalcFlatFileSize.pkg // Calculates the estimated number of lines in file for progress bar Use FileModes.pkg // Sets file modes when updating file Use FileOpenExclusiveTest.pkg // Do we have exclusive access to the file? Use Std_Help.pkg // DAW standard help package Use File_Dlg //AB-StoreTopEnd //AB-IgnoreStart Use cWizard.Pkg Use Windows.pkg Use dfRadio.pkg Use DfLine.Pkg Use dfCmbFrm.pkg //AB-IgnoreEnd Integer[2][] iSelectedFields Object dbImportWizard is a cWizard Set Size to 152 214 //AB-StoreTopStart Property string psWorkspaceSelection Property string psImportFileName Property string psDataFileName Property String psFileType "C" // C-CSV, F-Fixed Field, X-XML Property String psDelimiter "" Property Integer piImportDataFileNumber Property Integer piZeroFile Property Integer piAddToIDE Property Integer pbComplete False Use cDBImport.pkg // Import BPO package Set phoOwner of oHtmlHelp to (Self) // Help system //---------------------------------------------------------> // We jump through some hoops for the help because of the // workspace switching. Essentially, grab the help path // up front before selecting any workspace and stashing it. //---------------------------------------------------------> Procedure Show_Help_File String sWorkspaceHelp sRegKey sRegValue sHelpDir sHelpPath Boolean bOk bOpened Integer iError iPos #IF (FMAC_VERSION < |CI11) Move (SysConf(sysconf_runtime_name)) to sHelpPath Move (Pos("PROGRAMS", uppercase(sHelpPath))) to iPos Move (Left(sHelpPath, (iPos-1))+"Help") to sHelpPath Set psHelpFile of oHtmlHelp to (sHelpPath+"\"+sHelpFile) #ELSE // VDF 12 only Move ("Software\Data Access Worldwide\Visual DataFlex\" + Sysconf (SYSCONF_DATAFLEX_REV)) to sRegKey Move "dbImportHelpDirectory" to sRegValue Get OpenKey of oRegistry sRegKey to bOpened If bOpened Begin If (ValueExists(oRegistry(Self), sRegValue)); Get ReadString of oRegistry sRegValue to sHelpDir Else Begin Get CreateKey of oRegistry sRegKey to iError Move (SysConf(sysconf_runtime_name)) to sHelpPath Move (Pos("PROGRAMS", uppercase(sHelpPath))) to iPos Move (Left(sHelpPath, (iPos-1))+"Help\dbImport.chm") to sHelpPath If (iError =0) Send WriteString of oRegistry sRegValue sHelpPath End Send CloseKey to oRegistry End #ENDIF End_Procedure //AB-StoreTopEnd Set Location to 10 9 Set psLabel to "Data Import Wizard" //AB-DDOStart //AB-DDOEnd Object oWelcomePage is a cWelcomePage Set psWatermark to "WizardImport.Bmp" Set psTitle to "Data Import Wizard" Set psBottomText to "Click the 'Next' button to continue..." //AB-StoreStart // Kills it... set size of oHeaderGraphic to 0 0 Set Help_Id to 1000 Procedure OnEntering Integer iFrom Integer iDirection String sDescription Set Enabled_State Of oNextButton To True Send Activate to oNextButton Move ("This application is a partial companion to dbExport as it " + ; "will import Delimited, Fixed Field Length, and XML data that has " + ; "been output by dbExport, or it may be used to import data generated by " + ; "another source. The imported data may be with or without a " + ; "field name header. If desired, import code can be generated for all " + ; "three formats that may be modified to handle special cases.") To sDescription Move (sDescription + "\n\n") To sDescription Move (sDescription + "Recnum is never imported as field 0. \nThe Line Delimited " + ; "format is not available.") To sDescription Move (sDescription + "\n\n") To sDescription Move (sDescription + "This Wizard will guide you through the steps necessary " + ; "to configure the data import.") To sDescription Move (sDescription + "\n\n") To sDescription Set psDescription To sDescription Send Show_Help_File End_Procedure // OnEntering //AB-StoreEnd End_Object // oWelcomePage Object oSelectWorkspacePage is a cInteriorPage Set psTitle to "Workspace selection" Set psSubTitle to "On this page you will select the workspace to do the import." Object oWorkspaceKeyArray is a Array //AB/ Set Location to 46 20 End_Object // oWorkspaceKeyArray Object oNonSelectedTb is a Textbox Set Label to "Select the workspace" Set Location to 50 70 Set Size to 10 115 Set FontWeight to 600 Set TypeFace to "MS Sans Serif" End_Object // oNonSelectedTb #IF (FMAC_VERSION < |CI12) Object oWorkSpaceList is a cList //AB-StoreTopStart Set pbMultiSelect to False Procedure Mouse_Click Integer iWin Integer iChar Forward Send Mouse_Click iWin iChar Send OnClick to oNextButton End_Procedure //AB-StoreTopEnd Set Size to 154 220 Set Location to 62 70 End_Object // oWorkSpaceList #ELSE Object oVDF12orLaterWorkspace is a form Set Label to "Workspace:" Set Location to 90 70 Set Size to 13 275 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Prompt_Button_Mode to pb_PromptOn Procedure Prompt Send InitializeWSList End_Procedure Procedure Exiting Handle hoDestination Returns Integer Integer iFail iRC String sValue Forward Get MSG_Exiting hoDestination to iFail If (not(iFail)) Begin Get Value to sValue Get vFilePathExists sValue to iRC If (iRC <> True and hoDestination <> oCancelButton) Begin Send Stop_Box "The workspace file you have entered does not exist." "ERROR!" Move 1 to iFail End Set psWorkSpaceSelection to sValue Set Enabled_State of oNextButton to (sValue <> "") End Procedure_Return iFail End_Procedure End_Object // oNonSelectedTb Object oOpenFile is an OpenDialog Set Filter_String to ; 'Workspace Files - ws|*.ws' //Set Initial_Folder to 'C:\Program Files\Visual DataFlex 12.0\Projects' Set Filter_Index to 2 Set Size to 154 220 Set Location to 62 70 End_Object #ENDIF //AB-StoreStart //------------------------------------------------------------------> //*** Procedure: InitializeWSList //*** Purpose : Initialize the workspace list. //------------------------------------------------------------------> Procedure InitializeWSList Integer hoKeyArray Integer hoNameList Integer hKeyWrkSpc Handle hoSections Handle hoIniFile Integer iWorkspaceCount Integer iWorkspace String sWorkspace String sDescription String sVDFRootDir Boolean bOpen bReadOnly String sFileTitle sFileName Set Enabled_State of oNextButton to False //*** Get the objects to store the information Move (oWorkspaceKeyArray(Self)) To hoKeyArray Move (oWorkSpaceList(Self)) To hoNameList //*** only fill if empty If (Item_Count(hoKeyArray) = 0) Begin //*** Switch list screen updates off Set Dynamic_Update_State Of hoNameList To False #IF (FMAC_VERSION < |CI8) //*** Fill the objects REG_OPEN_KEY "SOFTWARE\Data Access Corporation\Visual DataFlex\7\WorkSpaces" To hKeyWrkSpc If (hKeyWrkSpc <> 0) Begin REG_ENUM_KEY_INFO (Object_Id (Self)) REG_ENUM_KEY hKeyWrkSpc Dffalse REG_CLOSE_KEY hKeyWrkSpc End #ELSEIF (FMAC_VERSION < |CI12) Move (oWorkspaceKeyArray(Self)) to hoSections Move (oWorkSpaceList(Self)) to hoNameList Get Create U_cIniFile to hoIniFile Get_Profile_String "Defaults" "VDFRootDir" to sVDFRootDir If (Right(sVDFRootDir,1) = "\") Begin Left sVDFRootDir to sVDFRootDir (Length(sVDFRootDir)-1) End Set psFilename of hoIniFile to (sVDFRootDir + "\bin\Workspaces.ini") Send ReadSections to hoIniFile hoSections Move (Item_Count(hoSections) - 1) to iWorkspaceCount For iWorkspace from 0 to iWorkspaceCount Get Value of hoSections iWorkspace to sWorkspace Get ReadString of hoIniFile sWorkspace "Description" "" to sDescription Send AddItem to hoNameList iWorkspace sWorkspace Loop Send Destroy of hoIniFile #ELSE Get Show_Dialog of (oOpenFile(Self)) to bOpen If bOpen Begin Get TickReadOnly_State of (oOpenFile(Self)) to bReadOnly Get File_Title of (oOpenFile(Self)) to sFileTitle Get File_Name of (oOpenFile(Self)) to sFileName Set psWorkSpaceSelection to sFileName Set Value of oVDF12orLaterWorkspace to sFileName Set Enabled_State of oNextButton to (sFileName <> "") End Else If (psWorkSpaceSelection(Self) = "") Send Info_Box "A workspace has not been selected" //*** Switch list screen updates on Set Dynamic_Update_State Of hoNameList To True //*** Give non selected list focus and select its first item Send Activate To hoNameList If (ItemCount(hoNameList)) Begin Set piCurrentItem Of hoNameList To 0 Set pbSelectState Of hoNameList 0 To (True) End End #ENDIF End_Procedure // InitializeWSLIst Procedure OnEntering Integer iFrom Integer iDirection Set Dynamic_Update_State to True //*** Fill the list if we are entering this in forward direction If (iDirection = WIZARD_FORWARD_NAVIGATE) Send InitializeWSList End_Procedure // OnEntering Procedure OnLeaving Integer iTo Integer iDirection Handle hoWSList Move (oWorkSpaceList(Self)) To hoWSList Send GetSelectedWorkspace hoWSList // (oNonSelectedTb(Self)) //*** Make sure we are able to use the next button on whatever page we are going to Set Enabled_State Of oNextButton To True End_Procedure // OnLeaving //----------------------------------------------------------------------------------> //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections //*** the user made. //----------------------------------------------------------------------------------> Function piNextPage Returns Integer Integer bFilelistSelection Integer bTableSelection Integer iCurrentPage Integer iPage Integer hoWizardPages Integer hoNextPage //*** Determine next page Get piCurrentpage To iCurrentPage Move (iCurrentPage + 1) To iPage //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Function_return iPage End_Function // piNextPage //----------------------------------------------------------------------------------> //*** Function: Reg_Key_Enum //*** Purpose : This is sent by using the REG_ENUM_KEY_INFO command in the procedure //*** InitializeWSList. The function gets the key handle and name as //*** arguments. //----------------------------------------------------------------------------------> Function Reg_Key_Enum Integer iKey String szKeyName Returns Integer String sWorkSpaceDescription Integer hoArray Integer hoKeyArray Integer hoNameList Integer iWSNumber //*** Get the objects to store the information Move (oWorkspaceKeyArray(Self)) To hoKeyArray Move (oWorkSpaceList(Self)) To hoNameList //*** Get the descrption of the workspace. This is what we show the user. Get_Profile_String ("WorkSpaces\" + szKeyName) "Description" To sWorkSpaceDescription If (Trim(sWorkSpaceDescription) = "") ; Move szKeyName To sWorkSpaceDescription //*** Store the keyname in the array, show the description in the list. //*** Internally we are only interested in the key name. Since we want to //*** show the descriptions in sorted order we will also store the //*** position of the corresponding key in the array. When the item is //*** selected we can retrieve the key name by using its posiiotn. Positions //** are stored in the Aux_Value property of the item. Get Item_count Of hoKeyArray To iWSNumber Set Array_value Of hoKeyArray Item iWSNumber To szKeyName Send AddItem To hoNameList iWSNumber sWorkSpaceDescription Function_Return 1 End_Function // Reg_Key_Enum //----------------------------------------------------------------------------------> //*** Procedure: GetSelectedWorkspace //*** Purpose : Move all selected items from the source list to the destination //*** list. Remove selected items from the source list in the process. //----------------------------------------------------------------------------------> Procedure GetSelectedWorkspace Integer hoSource Integer iCurItem Integer iNumItems Integer bSelected Integer iNumSelected Integer iLastSelectedItem #IF (FMAC_VERSION < |CI12) Get SelectCount of hoSource to iNumSelected If (iNumSelected <> 0) Begin Get ItemCount of hoSource to iNumItems For iCurItem from 0 to (iNumItems - 1) Get pbSelectState of hoSource iCurItem to bSelected If (bSelected) Begin Set psWorkspaceSelection to (psItemtext(hoSource, iCurItem)) Send CreateWorkspace to desktop (psWorkspaceSelection(Self)) End Loop End #ELSE Send CreateWorkspace to desktop (psWorkspaceSelection(Self)) #ENDIF End_Procedure // MoveSelectedItems //AB-StoreEnd End_Object // oSelectWorkspacePage Object oSelectTablePage is a cInteriorPage Set psTitle to "Table selection" Set psSubTitle to "On this page, select the table." Object oTableTb is a cTextbox //AB-StoreTopStart Set Label To ("Please select the table into which the data will be imported.") //AB-StoreTopEnd Set Auto_Size_State to FALSE Set Location to 50 30 Set Size to 35 275 Set Justification_Mode to jMode_Left Set TypeFace to "MS Sans Serif" End_Object // oTableTb Object oTableList is a Grid // cList Set Size to 130 300 Set Location to 86 30 Set Line_Width to 4 0 Set peAnchors to anAll Set Form_Width 0 to 35 Set Header_Label 0 to "Select" Set Form_Width 1 to 35 Set Header_Label 1 to "File #" Set Form_Width 2 to 70 Set Header_Label 2 to "File Name" Set Form_Width 3 to 145 Set Header_Label 3 to "Description" Set Select_Mode to Single_Select Set Highlight_Row_State to True // make shadowed text readable Set pbUseDisabledColor to True Set peDisabledColor to clWindow Set peDisabledTextColor to clWindowText Set pbSorted to False Procedure DoFillList handle hFile String sName sRootName Integer iItem Send ResetContent move 0 to hFile repeat get_Attribute DF_FILE_NEXT_USED of hFile to hFile if (hFile>0) begin get_Attribute DF_FILE_DISPLAY_NAME of hFile to sName Get_Attribute DF_FILE_LOGICAL_NAME of hFile to sRootName Get Item_Count to iItem Send Add_Item Msg_None "" Set Checkbox_Item_State iItem to True Get Item_Count to iItem Send Add_Item MSG_None (String(hFile)) Set Item_Shadow_State iItem to True Get Item_Count to iItem Send Add_Item MSG_None sRootName Set Item_Shadow_State iItem to True Get Item_Count to iItem Send Add_Item MSG_None sName Set Item_Shadow_State iItem to True End until (hFile=0) //*** Switch list screen updates on End_Procedure // DoFillList Procedure Mouse_Click Integer iWin integer iChar Forward Send Mouse_Click iWin iChar Send OnClick To oNextButton End_Procedure //AB-StoreTopEnd Procedure Select_Toggling Integer iItem Integer iState Integer iColumn iSelectCount String sValue If (iItem = CURRENT) Begin Get Current_Item to iItem End Move (Mod (iItem, 0)) to iColumn If (iColumn = 0) Begin // actually sets the checkbox Forward Send Select_Toggling iItem iState // File # Get Value (iItem+1) to sValue Set piImportDataFileNumber to sValue // File Name Get Value (iItem+2) to sValue Set psDataFileName to sValue Send DisableOrEnableNextPageButton End Get Select_Count to iSelectCount End_Procedure // Select_Toggling End_Object // oTableList //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection Handle hoTableList Move (oTableList(Self)) to hoTableList //*** Fill the list if we are entering this in forward direction If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Send DoFillList to hoTableList Set Dynamic_Update_State hoTableList to True //*** Give non selected list focus and select its first item Send Activate To hoTableList If (ItemCount(hoTableList)) Begin Set piCurrentItem Of hoTableList To 0 Set pbSelectState Of hoTableList 0 To (True) End End Set Enabled_State of oNextButton to False End_Procedure // OnEntering Procedure OnLeaving Integer iTo Integer iDirection Handle hoTableList Move (oTableList(Self)) to hoTableList //*** Make sure we are able to use the next button on whatever page we are going to Set Enabled_State Of oNextButton To True End_Procedure // OnLeaving //----------------------------------------------------------------------------------> //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. //----------------------------------------------------------------------------------> Function piNextPage Returns Integer Integer iCurrentPage Integer iPage Integer hoWizardPages Integer hoNextPage //*** Determine next page Get piCurrentpage To iCurrentPage Move (iCurrentPage + 1) to iPage //*** Set your own next page and make sure the next page jumps back here. Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Function_return iPage End_Function // piNextPage //----------------------------------------------------------------------------------> //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. //----------------------------------------------------------------------------------> Procedure DisableOrEnableNextPageButton Set Enabled_State of oNextButton to (Item_Count(oTableList(Self)) <> 0) End_procedure // DisableOrEnableNextPageButton //AB-StoreEnd End_Object // oSelectTablePage Object oSelectFieldPage is a cInteriorPage Set psTitle to "Field selection" Set psSubTitle to "Select all fields or the individual data fields and the order in which they will import." //----------------------------------------------------------------------------------> //*** Procedure: OnEntering //*** Purpose : Entering -- Settings for Field selection page //----------------------------------------------------------------------------------> Procedure OnEntering Integer iFrom Integer iDirection If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Send DoFillList to oFieldList Send ResetContent to oSelectedFieldList Set Checked_State of oExact_Match to True End Send DisableOrEnableNextPageButton End_Procedure // OnEntering Object oExact_Match is a CheckBox Set Label to "Are the data fields in the import file an exact match to the data file fields?" Set Size to 10 243 Set Location to 47 60 //AB-StoreStart Register_Function NumberOfSelectedFields Returns Integer Procedure OnChange Boolean bChecked Get Checked_State to bChecked // Exact match If bChecked Begin Set pbEnabled of oFieldList to False Set pbEnabled of oSelectedFieldList to False Set Enabled_State of oAdd_Btn to False Set Enabled_State of oRemove_Btn to False Set Enabled_State of oRefresh_Btn to False If (NumberOfSelectedFields(Self) = 0) ; Send ResetContent to oSelectedFieldList Send DisableOrEnableNextPageButton End // Select fields individually Else Begin Set pbEnabled of oFieldList to True Set pbEnabled of oSelectedFieldList to True Set Enabled_State of oAdd_Btn to True Set Enabled_State of oRemove_Btn to False Set Enabled_State of oRefresh_Btn to True Send DisableOrEnableNextPageButton Send Activate to oFieldList Set pbSelectState Of oFieldList 0 To (True) Send DisableOrEnableNextPageButton End End_Procedure // OnChange //AB-StoreEnd End_Object // oExact_Match Object oTextBox1 is a Textbox Set Auto_Size_State to False Set Label to "Select fields, in the correct order" Set Location to 66 11 Set Size to 10 119 Set FontWeight to 600 Set TypeFace to "MS Sans Serif" End_Object // oTextBox1 Object oFieldList is a cList //AB-StoreTopStart Set pbMultiSelect To True Set pbSorted To False Procedure Entering Forward Send Entering set Enabled_State of oAdd_Btn to True set Enabled_State of oRemove_Btn to False End_Procedure Procedure DoFillList handle hFile Integer iFile Integer iNumFields Integer iField# string sName string sRootName Send ResetContent Get piImportDataFileNumber to iFile Open iFile get_Attribute DF_FILE_NUMBER_FIELDS of iFile to iNumFields move 0 to hFile for iField# from 1 to iNumFields get_Attribute DF_FIELD_NAME of iFile iField# to sName Send AddItem iField# (string(iField#)+" "+ sName) loop Close iFile End_Procedure // DoFillList Procedure Mouse_Click Integer iWin integer iChar Forward Send Mouse_Click iWin iChar Send OnClick To oAdd_Btn End_Procedure //AB-StoreTopEnd Set Size to 135 138 Set Location to 79 10 Set Label_Col_Offset to 0 Set Label_Justification_Mode to jMode_Right Set Select_Mode to Multi_Select End_Object // oFieldList Object oRefresh_Btn is a Button Set Label to "Start Over" Set Location to 184 155 //AB-StoreStart Procedure OnClick Send DoFillList to oFieldList //Send ResetContent to oSelectedFieldList Send Delete_Data to oSelectedFieldList Send OnChange to oExact_Match End_Procedure // OnClick //AB-StoreEnd End_Object // oRefresh_Btn Object oAdd_Btn is a Button Set Label to "Add >>" Set Location to 106 155 //AB-StoreStart Procedure OnClick Send AddSelectedItems Send DisableOrEnableNextPageButton End_Procedure // OnClick //AB-StoreEnd End_Object // oAdd_Btn Object oRemove_Btn is a Button Set Label to "<< Remove" Set Location to 141 155 //AB-StoreStart Procedure OnClick Send RemoveSelectedItems Send DisableOrEnableNextPageButton End_Procedure // OnClick //AB-StoreEnd End_Object // oRemove_Btn Object oTextBox2 is a Textbox Set Auto_Size_State to False Set Label to "Selected Fields" Set Location to 66 212 Set Size to 10 51 Set FontWeight to 600 Set TypeFace to "MS Sans Serif" End_Object // oTextBox2 Object oSelectedFieldList is a grid //cList //AB-StoreTopStart Set Size to 130 143 Set Location to 79 210 Set Select_Mode to Multi_Select Set Line_Width to 2 0 Set Form_Width 0 to 80 Set Header_Label 0 to "Field" Set Form_Width 1 to 54 Set Header_Label 1 to "Ignore Text" Set Highlight_Row_State to True // make shadowed text readable Set pbUseDisabledColor to True Set peDisabledColor to clWindow Set peDisabledTextColor to clWindowText Set pbMultiSelect to True Set pbSorted To False Procedure Mouse_Click Integer iWin integer iChar Forward Send Mouse_Click iWin iChar Send OnClick to oRemove_Btn End_Procedure Procedure Mouse_Down Integer iWindowNumber Integer iPosition Forward Send Mouse_Down iWindowNumber iPosition // Set piCurrentItem to (Current_Item(Self)) End_Procedure Procedure Entering Forward Send Entering set Enabled_State of oAdd_Btn to False set Enabled_State of oRemove_Btn to True End_procedure //AB-StoreTopEnd End_Object // oSelectedFieldList //AB-StoreStart //*** //*** Procedure: MoveSelectedItems //*** Purpose : Move all selected items from the source list to the destination //*** list. Remove selected items from the source list in the process. //*** Procedure MoveSelectedItems Integer hoSource Integer hoDest Integer iCurItem Integer iNumItems Integer bSelected Integer iNumSelected Integer iLastSelectedItem Integer iHoldLast Integer iItem //*** Traverse the selected list and add the items to the selected list Get SelectCount Of hoSource To iNumSelected If (iNumSelected <> 0) Begin Get ItemCount Of hoSource To iNumItems For iCurItem From 0 To (iNumItems - 1) Get pbSelectState Of hoSource iCurItem To bSelected If (bSelected) Begin // Send AddItem To hoDest (piItemData(hoSource, iCurItem)) (psItemtext(hoSource, iCurItem)) Get Item_Count of hoDest to iItem Send Add_Item to hoDest Msg_None (psItemtext(hoSource, iCurItem)) Set Item_Shadow_State of hoDest iItem to True Get Item_Count of hoDest to iItem Send Add_Item to hoDest Msg_None "" Set Checkbox_Item_State of hoDest iItem to True Move (iCurItem+1) To iLastSelectedItem End Loop //*** Traverse the selected list and remove the items that are selected Move 0 To iCurItem While (iCurItem < ItemCount(hoSource)) Get pbSelectState Of hoSource iCurItem To bSelected If (bSelected) ; Send DeleteItem to hoSource iCurItem Else ; Increment iCurItem End End //*** Restore selection If (ItemCount(hoSource)) Begin If (iNumSelected = 1 And iLastSelectedItem > 0) Begin Set piCurrentItem Of hoSource To (iLastSelectedItem - 1) Set pbSelectState Of hoSource (iLastSelectedItem - 1) To (True) End Else Begin Set piCurrentItem Of hoSource To 0 Set pbSelectState Of hoSource 0 To (True) End End End_procedure // MoveSelectedItems //*** //*** Procedure: AddSelectedItems //*** Purpose : Move selected items from non selected list to the selected list //*** Procedure AddSelectedItems Integer hoNonSelectedList Integer hoSelectedList Move (oFieldList(Self)) To hoNonSelectedList Move (oSelectedFieldList(Self)) To hoSelectedList Send MoveSelectedItems hoNonSelectedList hoSelectedList End_procedure // AddSelecteditems //*** //*** Procedure: RemoveSelectedItems //*** Purpose : Move selected items from selected list to the non selected list //*** Procedure RemoveSelectedItems Integer hoNonSelectedList Integer hoSelectedList iCI iNumItems String sValue Move (oFieldList(Self)) To hoNonSelectedList Move (oSelectedFieldList(Self)) To hoSelectedList // Remove from the selected field grid // User can click on either column, so must plan for it Get Current_Item of hoSelectedList to iCI // Keep the delete_item calls in this order If (Mod(iCI, 2) = 0) Begin // Add back in left side list Get Value of hoSelectedList item iCI to sValue Get ItemCount of hoNonSelectedList to iNumItems Send AddItem to hoNonSelectedList iNumItems sValue // Remove from the right Send Delete_Item to hoSelectedList (iCI+1) Send Delete_Item to hoSelectedList iCI End Else Begin Get Value of hoSelectedList item (iCI-1) to sValue Get ItemCount of hoNonSelectedList to iNumItems Send AddItem to hoNonSelectedList iNumItems sValue Send Delete_Item to hoSelectedList iCI Send Delete_Item to hoSelectedList (iCI-1) End End_Procedure // RemoveSelecteditems //*** //*** Function: NumberofSelectedFields //*** Purpose : Returns the number of fields that where selected //*** Function NumberOfSelectedFields Returns Integer Function_Return (Item_Count(oSelectedFieldList(Self))) End_function // NUmberOfSelectedFields //*** //*** Function: SelectedFields //*** Purpose : Adds selected field numbers to oFieldArray //*** Procedure SelectedFields String sLine Integer iFieldNumber iField iNumberFields iPos iItem iElementCount iSkip Handle hoSelectedFields Move (oSelectedFieldList(Self)) to hoSelectedFields Move (NumberOfSelectedFields(Self)) to iNumberFields If (iNumberFields > 0) Begin Move (ResizeArray(iSelectedFields [0], 0)) to iSelectedFields[0] Move (ResizeArray(iSelectedFields [1], 0)) to iSelectedFields[1] For iField from 0 to iNumberFields If (Mod(iField, 2) = 0) Begin // Only select the array element on the even cycle Move (SizeOfArray(iSelectedFields[0])) to iElementCount Get Value of hoSelectedFields iField to sLine Move (Pos(" ", sLine)) to iPos If (Integer(sLine) > 0); Move (Left(sLine, (iPos-1))) to iSelectedFields[0][iElementCount] End Else Begin Get Select_State of hoSelectedFields iField to iSkip If (Integer(sLine) > 0); Move iSkip to iSelectedFields[1][iElementCount] End Loop End //Move (SizeOfArray(iSelectedFields[0])) to iNumberFields //For iItem from 0 to (iNumberFields-1) // Showln iSelectedFields[0][iItem] " - " iSelectedFields[1][iItem] //Loop End_Procedure // SelectedFields //----------------------------------------------------------------------------------> //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if checkbox is checked or something //*** selected. //----------------------------------------------------------------------------------> Procedure DisableOrEnableNextPageButton Boolean bChecked Get Checked_State of oExact_Match to bChecked Set Enabled_State of oNextButton to (bChecked or Item_Count(oSelectedFieldList(Self)) <> 0) End_procedure // DisableOrEnableNextPageButton Procedure OnLeaving Integer iTo Integer iDirection Send SelectedFields End_Procedure // OnLeaving //AB-StoreEnd End_Object // oSelectFieldPage Object oImportFileType is a cInteriorPage Set psTitle to "What type of file is to be imported?" Set psSubTitle to "On this page indicate what type of file is to be imported, delimited, fixed field, or XML. \nYou will also need to indicate some other choices and enter the import file name." Object oInstructionsText is a cTextbox //AB-StoreTopStart Set Label To ("If you choose to zero the file before importing, all users will need to be out of the file.\n\n" + ; "A 'header' is a row of data field names as the first row. This will be skipped if there.") //AB-StoreTopEnd Set Auto_Size_State to FALSE Set Location to 44 30 Set Size to 23 285 Set Justification_Mode to jMode_Left Set TypeFace to "MS Sans Serif" End_Object // oInstructionsText Object oFileTypeRadioGrp is a RadioGroup Set Size to 54 147 Set Location to 77 105 Set Label to "File Type" Object oRadio1 is a Radio Set Label to "Delimited" Set Size to 10 71 Set Location to 10 5 End_Object // oRadio1 Object oRadio2 is a Radio Set Label to "XML" Set Size to 10 31 Set Location to 25 5 End_Object // oRadio2 Object oRadio3 is a Radio Set Label to "Fixed Field Length" Set Size to 10 74 Set Location to 40 5 End_Object // oRadio3 //AB-StoreStart Procedure Notify_Select_State Integer iToItem Integer iFromItem Forward Send Notify_Select_State iToItem iFromItem If (iToItem = 0) Set psFileType to "C" If (iToItem = 1) Set psFileType to "X" If (iToItem = 2) Set psFileType to "F" If (iToItem = 1) Set Enabled_State of oHeaderRowCheckbox to False Else Set Enabled_State of oHeaderRowCheckbox to True If (iToItem = 0) Begin Set Value of oDelimitCombo to ", Comma" Set Enabled_State of oDelimitCombo to True Set Enabled_State of oOtherDelimiter to True End Else Begin Set Enabled_State of oDelimitCombo to False Set Enabled_State of oOtherDelimiter to False End End_Procedure // Notify_Select_State //AB-StoreEnd End_Object // oFileTypeRadioGrp Object oZeroFileCheckBox is a CheckBox Set Label to "Zero the file before importing?" Set Size to 10 120 Set Location to 136 105 //AB-StoreStart Procedure OnChange Boolean bChecked Get Value To bChecked Set piZeroFile to bChecked End_Procedure // OnChange //AB-StoreEnd End_Object // oZeroFileCheckBox Object oHeaderRowCheckbox is a CheckBox Set Label to "Is there a header row?" Set Size to 10 87 Set Location to 149 105 End_Object // oHeaderRowCheckbox Object oHexCheckbox is a CheckBox Set Label to "Import Text && Binary from Hex?" Set Size to 10 120 Set Location to 163 105 End_Object // oHexCheckbox Object oLineControl2 is a LineControl Set Size to 2 354 Set Location to 72 2 End_Object // oLineControl2 Object oDelimitCombo is a ComboForm Set Label to "Data Delimiter:" Set Size to 13 91 Set Location to 178 105 Set Form_Border to 0 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Combo_Sort_State to False Procedure Combo_Fill_List Send Combo_Add_Item ", Comma" Send Combo_Add_Item "; Semicomma" Send Combo_Add_Item "~ Tilde" Send Combo_Add_Item "* Asterisk" End_Procedure // Combo_Fill_List Procedure OnChange String sValue Get Value To sValue Set psDelimiter to (Left(sValue, 1)) Send DisableOrEnableNextPageButton End_Procedure // OnChange //AB-StoreEnd End_Object // oDelimitCombo Object oOtherDelimiter is a Form Set Label to "Other Delimiter:" Set Size to 13 25 Set Location to 178 272 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right //AB-StoreStart Set Form_Margin item 0 to 1 Procedure OnChange String sValue Get Value To sValue If (sValue <> "") Set psDelimiter to sValue Send DisableOrEnableNextPageButton End_Procedure // OnChange //AB-StoreEnd End_Object // oOtherDelimiter Object oImportFileName is a Form Set Label to "Import File Name:" Set Size to 13 243 Set Location to 196 105 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Prompt_Button_Mode to pb_PromptOn //AB-StoreStart Procedure OnChange String sValue Get Value To sValue Set psImportFileName to sValue Send DisableOrEnableNextPageButton End_Procedure // OnChange Procedure Prompt Send FindImportFile End_Procedure Procedure Exiting Integer iToObj String sFile Integer iNotOpen iFail Forward Get MSG_Exiting iToObj to iFail If (not(iFail)) Begin Get value to sFile Direct_Input sFile Move (SeqEof) to iNotOpen Close_Input If (iToObj <> oCancelButton and iNotOpen) Begin Send Stop_Box "The import file does not exist!" "ERROR!" Move 1 to iFail End Set psImportFileName to sFile End Procedure_Return iFail End_Procedure //AB-StoreEnd End_Object // oImportFileName //AB-StoreStart //----------------------------------------------------------------------------------> //*** Procedure: FindImportFile //*** Purpose : Let user select the file to be imported //----------------------------------------------------------------------------------> Procedure FindImportFile String sTableName String sCurTableName String sFileType Integer hoOpenDialog Integer hoTableList Integer bSelected Integer iNumTables Integer iCurTable Integer bExists Get psFileType to sFileType //*** Create theobject and setup its appearance Get Create U_OPENDIALOG To hoOPenDialog Set CreatePrompt_State Of hoOpenDialog To False If (sFileType = "X"); Set Filter_String Of hoOpenDialog To "XML files|*.XML" Else if (sFileType = "C"); Set Filter_String Of hoOpenDialog To "Text files|*.txt|CSV files|*.csv|All files|*.*" Else if (sFileType = "F"); Set Filter_String Of hoOpenDialog To "Text files|*.lst|All files|*.*" Set Dialog_Caption Of hoOpenDialog To "Please select a file to be imported" //*** Select a table Move (oTableList(Self)) To hoTableList Get Show_Dialog Of hoOpenDialog To bSelected If (bSelected) Begin Get File_Name Of hoOpenDialog To sTableName Set Value of oImportFileName to sTableName End //*** Destroy the object Send Destroy To hoOpenDialog //*** Adjust the next button's enabled state Send DisableOrEnableNextPageButton End_procedure // AddTable //----------------------------------------------------------------------------------> //*** Function: IsThereAHeader //*** Purpose : Return whether a header is being used in the import file //----------------------------------------------------------------------------------> Function IsThereAHeader Returns String String sInstructions Integer bChecked Get Checked_State of (oHeaderRowCheckbox(Self)) To bChecked If (bChecked = 0) ; Move "No header is contained in the import file" To sInstructions Else ; Move "Ignore the header contained in the import file" To sInstructions Function_Return sInstructions End_Function // IsThereAHeader //----------------------------------------------------------------------------------> //*** Function: ZeroTheFile //*** Purpose : Return whether we will zero the file before starting //----------------------------------------------------------------------------------> Function ZeroTheFile Returns String String sInstructions Integer bChecked Get piZeroFile to bChecked If (bChecked = 0) ; Move "The data file will NOT be zeroed before the import" To sInstructions Else ; Move "The data file WILL be zeroed before the import" To sInstructions Function_Return sInstructions End_Function // ZeroTheFile //----------------------------------------------------------------------------------> //*** Function: TextAsHex //*** Purpose : Will text and binary be imported as hex? //----------------------------------------------------------------------------------> Function TextAsHex Returns String String sInstructions Integer bChecked Get Checked_State of (oHexCheckBox(Self)) To bChecked If (bChecked = 0) ; Move "Text and binary will be imported as normal" To sInstructions Else; Move "Text and binary will be imported from Hex" To sInstructions Function_Return sInstructions End_Function // TextAsHex //----------------------------------------------------------------------------------> //*** Function: FileType //*** Purpose : Return the type of file //----------------------------------------------------------------------------------> Function FileType Returns String String sInstructions If (psFileType(Self) = "C") ; Move "In a delimited file format" To sInstructions If (psFileType(Self) = "X") ; Move "In an XML file format" To sInstructions If (psFileType(Self) = "F") ; Move "In a fixed field length file format" To sInstructions Function_Return sInstructions End_Function // FileType //----------------------------------------------------------------------------------> //*** Procedure: OnEntering //*** Purpose : Depending on whether the user enters a file name //----------------------------------------------------------------------------------> Procedure OnEntering Integer iFrom Integer iDirection Send DisableOrEnableNextPageButton End_Procedure // OnEntering //----------------------------------------------------------------------------------> //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. //----------------------------------------------------------------------------------> Procedure DisableOrEnableNextPageButton Set Enabled_State Of oNextButton To (value(oImportFileName(Self)) <> "") End_procedure // DisableOrEnableNextPageButton //----------------------------------------------------------------------------------> //*** Procedure: piNextPage //*** Purpose : What page do we go to next? //----------------------------------------------------------------------------------> Function piNextPage Returns Integer String sFileType Integer iPage Integer hoWizardPages Integer hoNextPage Integer iCurrentPage //*** Determine next page Get piCurrentpage To iCurrentPage Move (iCurrentPage + 1) To iPage //*** Set your own next page and make sure the next page jumps back here. Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Function_return iPage End_Function // piNextPage //AB-StoreEnd End_Object // oImportFileType Object oImportOrCode is a cInteriorPage Set psTitle to "Import or Write Code?" Set psSubTitle to "On this page you will indicate whether to import data directly or create a program \nto do it." Object oInstructionsText is a cTextbox //AB-StoreTopStart Set Label To "" //AB-StoreTopEnd Set Auto_Size_State to FALSE Set Location to 50 30 Set Size to 23 265 Set Justification_Mode to jMode_Left Set TypeFace to "MS Sans Serif" End_Object // oInstructionsText Object oImportOrCodeRadioGrp is a RadioGroup Set Size to 41 157 Set Location to 90 103 Object oRadio1 is a Radio Set Label to "Import data into the selected file" Set Size to 10 124 Set Location to 10 5 End_Object // oRadio1 Object oRadio2 is a Radio Set Label to "Write code for a data import program" Set Size to 10 135 Set Location to 25 5 End_Object // oRadio2 //AB-StoreStart Procedure Notify_Select_State Integer iToItem Integer iFromItem If (not(giIn_VDF12orLater)) Begin If (iToItem = 0) Begin Set Checked_State of oIDECheckBox to False Set Enabled_State of oIDECheckBox to False End Else Set Enabled_State of oIDECheckBox to True End Forward Send Notify_Select_State iToItem iFromItem End_Procedure // Notify_Select_State //AB-StoreEnd End_Object // oImportOrCodeRadioGrp Object oIDECheckbox is a CheckBox Set Label to "Add view to IDE Files for IDE Compatibility?" Set Size to 10 156 Set Location to 142 103 //AB-StoreStart If (giIn_VDF12orLater) Begin Set Enabled_State to False Set Visible_State to False End Procedure OnChange Boolean bChecked Get Checked_State To bChecked Set piAddToIDE to bChecked End_Procedure // OnChange //AB-StoreEnd End_Object // oIDECheckbox //AB-StoreStart //----------------------------------------------------------------------------------> //*** Function: ImportOrCode //*** Purpose : Return the selected mode of operation //----------------------------------------------------------------------------------> Function ImportOrCode Returns String String sFormat Integer iCurrentRadio Get Current_Radio Of (oImportOrCodeRadioGrp(Self)) To iCurrentRadio If (iCurrentRadio = 0) ; Move "directly import the data" To sFormat Else ; Move "write a program to import the data" To sFormat Function_Return sFormat End_Function // ImportOrCode //----------------------------------------------------------------------------------> //*** Procedure: OnEntering //*** Purpose : //----------------------------------------------------------------------------------> Procedure OnEntering Integer iFrom Integer iDirection Set Label of oInstructionsText To ("The wizard will either import data or will output code that you may modify for odd " + ; "import formats -- those that do not exactly match the data file structure.") End_Procedure // OnEntering Function piNextPage Returns Integer String sFileType Integer iPage Integer hoWizardPages Integer hoNextPage Integer iCurrentPage Boolean bOpen Boolean bChecked //*** Determine next page Get piCurrentpage To iCurrentPage Get piZeroFile to bChecked If (bChecked and Current_Radio(oImportOrCodeRadioGrp(Self)) = 0) Begin Move (DoCheckForExclusiveAccess(Self, piImportDataFileNumber(Self))) to bOpen If (bOpen = Dffalse) Begin Send Info_Box "Zeroing has been selected, but the file is open, all users will need to be out of the file." "Info!" Function_Return iCurrentPage End End Move (iCurrentPage + 1) To iPage //*** Set your own next page and make sure the next page jumps back here. Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Function_return iPage End_Function // piNextPage //----------------------------------------------------------------------------------> //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. //----------------------------------------------------------------------------------> Procedure DisableOrEnableNextPageButton Set Enabled_State Of oNextButton To (psDelimiter(Self) <> "") End_procedure // DisableOrEnableNextPageButton //AB-StoreEnd End_Object // oImportOrCode Object oSummaryPage is a cInteriorPage Set psTitle to "Summary" Set psSubTitle to "When you click 'Next' the Wizard will perform the import as outlined below." Object oSummaryWarningTb is a Textbox Set Label to "Import Summary:" Set Location to 50 30 Set Size to 10 185 Set FontWeight to 600 Set TypeFace to "MS Sans Serif" End_Object // oSummaryWarningTb Object oSummaryEdit is a Edit //AB-StoreTopStart Set Read_Only_State To True Set Scroll_Bar_Visible_State to False //AB-StoreTopEnd Set Size to 155 277 Set Location to 65 30 Set Color to clBtnFace End_Object // oSummaryEdit //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection String sSummary String sItemText Integer bWorkspaceSelection Integer bFilelistSelection Integer bTableSelection Integer hoEdit Integer iNumItems Integer iCurItem Integer hoPage Integer iImportOrCode //*** delte all text from the summary editor Move (oSummaryEdit(Self)) To hoEdit Send Delete_Data To hoEdit //*** Empty text Move "" To sSummary //*** Show explanation Move ("The selections you have made in the import Wizard are summarized " + ; "below. Read this summary carefully. If you agree with the settings, " + ; "click the next button to proceed. If you want to change a selection, " + ; "click the back button.\n\n") To sSummary //*** Workspace Move ("In workspace "+psWorkspaceSelection(Self)+",\n\n") to sSummary //*** Data file Move (Append(sSummary, "For data file "+psDataFileName(Self)+",\n\n")) To sSummary //*** Show if import or write code Move (Append(sSummary, "We will " + ImportOrCode(oImportOrCode(Self)) + "\n\n")) To sSummary //*** What is the file type Move (Append(sSummary, FileType(oImportFileType(Self)) + "\n\n")) To sSummary // *** Import file name Move (Append(sSummary, "From import file "+psImportFileName(Self)+"\n\n")) To sSummary If (psFileType(Self) = "C"); Move (Append(sSummary, ("With delimiter: "+psdelimiter(Self))+"\n\n")) to sSummary //*** Is there a header record? Move (Append(sSummary, IsThereAHeader(oImportFileType(Self)) + "\n\n")) To sSummary //*** Zero the file? Move (Append(sSummary, ZeroTheFile(oImportFileType(Self)) + "\n\n")) To sSummary //*** Text and binary from hex Move (Append(sSummary, TextAsHex(oImportFileType(Self)) + "\n\n")) To sSummary //*** Put text in editor Send Append_Text To hoEdit (Replaces("\n", sSummary, Character(13) + Character(10))) Send Beginning_Of_Data To hoEdit //*** Program or import? Get Current_Radio Of (oImportOrCodeRadioGrp(oImportOrCode(Self))) To iImportOrCode If (iImportOrCode) Set Label of oSummaryWarningTb to "Going to the next page will start code creation process." Else Set Label of oSummaryWarningTb to "Going to the next page will start the import process." End_Procedure // OnEntering //----------------------------------------------------------------------------------> //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. //----------------------------------------------------------------------------------> Function piNextPage Returns Integer Integer iCurrentPage Integer iPage Integer hoWizardPages Integer hoNextPage Integer iImportOrCode Get Current_Radio Of (oImportOrCodeRadioGrp(oImportOrCode(Self))) To iImportOrCode Get piCurrentpage To iCurrentPage Send DoProcess to oDBImport If (pbComplete(Self) = False) move iCurrentPage to iPage Else Move (iCurrentPage + 1) To iPage //*** Set your own next page and make sure the next page jumps back here. Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Function_return iPage End_Function // piNextPage //AB-StoreEnd End_Object // oSummaryPage Object oCompletionPage is a cCompletionPage Set psWatermark to "WizardImport.Bmp" Set psTitle to "Data Import Completed" Set psBottomText to "Click on 'Finish' to exit the wizard" //AB-StoreStart set size of oHeaderGraphic to 0 0 Procedure OnEntering Integer iFrom Integer iDirection String sRootName String sMsg Integer iFile# Integer iImportOrCode String sFileTypeId String sFileType // Don't need this, job is already done and Finish does same thing. Set enabled_state of oCancelButton to False Set enabled_state of oBackButton to False Get psFileType to sFileType If (sFileType = "C") Move "CSV" to sFileTypeId If (sFileType = "F") Move "FFL" to sFileTypeId If (sFileType = "X") Move "XML" to sFileTypeId //*** Data file number Get piImportDataFileNumber To iFile# //*** Set the description Move ("The data import wizard has completed it's task.\n\n") to sMsg //*** Program or import? Get Current_Radio Of (oImportOrCodeRadioGrp(oImportOrCode(Self))) To iImportOrCode If (iImportOrCode) Begin get_Attribute DF_FILE_LOGICAL_NAME of iFile# to sRootName Move (append(sMsg, "An import program named "+(UPPERcase(sRootName+"_import_"+sFileTypeId+".src"))+" has been created " + ; "and placed in the source code directory of workspace "+psWorkspaceSelection(Self))) to sMsg Set psTitle to "Code Creation Completed" End Set psDescription To sMsg End_Procedure // OnEntering //AB-StoreEnd End_Object // oCompletionPage //AB-StoreStart //Procedure FinishWizard // Forward Send FinishWizard //End_Procedure // FinishWizard //AB-StoreEnd End_Object // dbImportWizard //AB-StoreStart Send Popup_Modal to dbImportWizard //AB-StoreEnd //AB/ End_Object // prj