Use cDbModalPanel.pkg Use Windows.pkg Use Cursor.pkg Use vWin32fh.pkg Object oChangeAllSourceFilesPath is a cDbModalPanel Set Label to "Change Source Files Path" Set Size to 111 413 Set Location to 2 2 Property Integer piCodeHdrID Property String psFromPath "" Object oInfo_tb is a TextBox Set Auto_Size_State to False Set Size to 18 395 Set Location to 9 9 Set Label to "Use the dialog to change paths for all Source Files that share the same path for the currently selected project." Set Justification_Mode to JMode_Left End_Object Object oFromPath_fm is a Form Set Size to 13 341 Set Location to 40 9 Set Label_Justification_Mode to JMode_Top Set Label_Col_Offset to 0 Set Label to "From Path:" Set Label_Row_Offset to 1 Set peAnchors to anTopLeftRight End_Object Object oToPath_fm is a Form Set Size to 13 341 Set Location to 65 9 Set Label_Justification_Mode to JMode_Top Set Label_Col_Offset to 0 Set Label to "To Path:" Set Label_Row_Offset to 1 Set peAnchors to anTopLeftRight End_Object Object oBrowseFrom_btn is a Button Set Size to 13 50 Set Label to "Browse..." Set Location to 65 355 Set peAnchors to anTopRight Procedure OnClick String sPath Get vSHBrowseForFolder "Select a New Path" to sPath If (sPath <> "") Begin Set Value of oToPath_fm to sPath End End_Procedure End_Object Object oOK_btn is a Button Set Label to "&OK" Set Location to 91 300 Set peAnchors to anTopRight Procedure OnClick String sFromPath sToPath Integer iRetval iCodeHdrID Get piCodeHdrID to iCodeHdrID If (iCodeHdrID = 0) Begin Send Stop_Box "No source code files exists. Process interrupted." Procedure_Return End Get Value of oFromPath_fm to sFromPath Get Value of oToPath_fm to sToPath If (sFromPath = "" or sToPath = "") Begin Send Info_Box "Please enter both a From and a To Path and try again." Procedure_Return End Get YesNo_Box ("Change all path occurrences for the current project from:\n" + sFromPath * "\nTo path:\n" + sToPath) to iRetval If (iRetval <> MBR_Yes) Begin Procedure_Return End Send ChangeCurrentSourcePaths sFromPath sToPath iCodeHdrID Send Close_Panel Send Info_Box "Ready! Selected source paths changed." End_Procedure Procedure ChangeCurrentSourcePaths String sFromPath String sToPath Integer iCodeHdrID String sPath sFileName Send Cursor_Wait of Cursor_Control Get vFolderFormat sFromPath to sFromPath Get vFolderFormat sToPath to sToPath Clear CodeDtl Constraint_Set (Self) Constrain CodeDtl.CodeHdrID eq iCodeHdrID Constrained_Find First CodeDtl by Index.1 While (Found) Move (Trim(CodeDtl.FullSourceFileName)) to sFileName Get ParseFolderName sFileName to sPath If (Uppercase(sPath) = Uppercase(sFromPath)) Begin Move (Replace(sPath, sFileName, sToPath)) to sFileName Reread CodeDtl Move sFileName to CodeDtl.FullSourceFileName SaveRecord CodeDtl Unlock End Constrained_Find Next Loop Send Cursor_Ready of Cursor_Control End_Procedure End_Object Object oCancel_btn is a Button Set Size to 14 50 Set Label to "&Close" Set Location to 91 355 Set peAnchors to anTopRight Procedure OnClick Send Close_Panel End_Procedure End_Object Procedure Page Integer iPageObject String sFromPath Get psFromPath to sFromPath Set Value of oFromPath_fm to sFromPath Forward Send Page iPageObject End_Procedure On_Key Key_Alt+Key_O Send KeyAction of oOk_btn On_Key Key_Alt+Key_C Send KeyAction of oCancel_btn End_Object Procedure ActivateChangeSourceFilesPath String sFromPath Integer iCodeHdrID Handle ho Move oChangeAllSourceFilesPath to ho Set piCodeHdrID of ho to iCodeHdrID Set psFromPath of ho to sFromPath Send Popup of ho End_Procedure