Other - All Files

Functions of type eOtherFunctionAll receive all selected files of the workspace at once. They are used for changes that need to look at several files together.
Cancel handling inside refactoring functions
If a refactoring function (especially of the eOtherFunction and eOtherFunctionAll types) loops over many lines or files, it can let the user cancel without waiting for the loop to finish. Use:
Get pbUserCancelRequested of ghoEngine to bCancel
and leave the loop when it returns True. Never call Get Cancel_Check of ghoEngine from inside a refactoring function. That is the engine's own cancel handling: it closes the status panel and shows the confirmation dialog, and calling it from a function uses up the cancel request without anyone noticing. The engine then cannot see the cancel, and the program seems to hang while it continues with the remaining files. pbUserCancelRequested only reads the state and changes nothing, so the engine's own cancel check between files still works.
AlignCollidingDeclarationType
Changes a name that is declared with more than one type so that all its declarations have the same type. This fixes error 4544 in DataFlex 25 and 26 for a name that is declared only in the workspace, where renaming would not help.
The function's parameter is 'Name=Type', for example 'pbSilent=Boolean'.
Only declaration lines are changed (Property <type> <name>, Function <name> ... Returns <type>); no calls are changed. Changing a declared type can change what the code does, so read the report first.
Which 4544 fix to choose: rename the name when DataFlex itself declares it with a different type, because that declaration cannot be changed. Use this function when the declarations that differ are all in the workspace; renaming all of them would only move the same problem to the new name. A typical case: pbSilent is declared as Boolean in two packages and as String in a third, and changing one word makes them the same.
It never runs unless you choose it. Only you know whether some code assigns a value that the new type cannot hold, so the guided flow shows the file, the line and both types before it runs, and the run summary lists every line it changed.
When it is selected without a parameter, or with a parameter that is not Name=Type, it changes nothing and says so in the run notes.
A declaration marked Overloaded is not changed, and the run notes say how many there were. Overloaded versions are meant to return different types, because DataFlex chooses between them by the number of parameters, so they cause no 4544 error.
Group: Modernization
ChangeCollidingMethodName
Renames a method that is declared with more than one return type. This fixes error 4544 in DataFlex 25 and 26 at the declaration, which changing the calls alone cannot fully do.
The function's parameter is 'OldName=NewName', for example 'Value=ValueByKey'.
The declaration is renamed in the class and all its subclasses, and so is every call where the object can be shown to belong to one of them. Calls where this cannot be shown are listed on the Manual Changes tab instead of being guessed.
Renaming the declaration fixes every call of the name, including calls that continue on the next line, calls inside a macro (reported where the macro is used), and calls in DataFlex's own packages, which are never changed. In one test workspace, 3 declarations were behind about 400 calls.
A subclass that overrides the method is renamed too; otherwise the workspace would be only partly renamed and still ambiguous. Object declarations are recognised in the whole workspace (Register_Object), while a local handle from Get Create is only followed within its own file.
A declaration outside the workspace's home folder is renamed and also reported, because a shared library can be used by other workspaces as well, which still compile with the old name.
Nothing is guessed: this also runs on library code, so a call whose object type cannot be determined from the source code is reported, never changed.
A name declared as Overloaded is not changed: DataFlex chooses the version by the number of parameters, so several return types are valid and no 4544 error occurs.
Group: Modernization
ChangeDFCreateMenuToCodeJock
Converts the legacy DFCreate_Menu / On_Item pull-down menus to a CodeJock menu bar.
Standard DEO menu items become the cCJ* classes that come with DataFlex, with their own translated captions. The program's own items become cCJMenuItem objects whose OnExecute sends the same message.
Menu files included with #INCLUDE are copied into the program, from the program's folder or from the Pkg folder of the target DataFlex installation (File_pm.inc, Navi_pm.inc ...). If you select a menu file itself (a .mn or .mnu file, or an .inc or .pkg file with a pull-down menu), the program that includes it is converted; the menu file is never changed.
A pull-down menu's OnInitMenu becomes the menu's OnPopupInit: Shadow_State Item N becomes the opposite of pbEnabled of the Nth item, Select_State becomes pbChecked, and the rest is copied as it is. A separator, or an item number that is not a fixed number, is left with a TODO line. An included file that contains only methods stays an #Include inside the menu bar object.
The legacy menu is commented out, never deleted; an empty menu does not get a menu bar. The function finds where to add the menu bar itself (an existing cCJCommandBarSystem, or else the client area), so it can run before or after the conversion of the application window, and running it a second time changes nothing.
Not converted: a program whose menu contains other procedures or functions of its own is left unchanged and named in the run notes. A menu file that no program includes is reported, not converted. Shortcut key texts are kept as comments, not set up as shortcut keys.
Group: Modernization
ConvertGridSubclassToCodeJock
Converts the workspace's subclasses of the legacy grids, together with every object of each subclass: Class MyDbGrid is a dbGrid becomes Class MyDbGrid is a cDbCJGrid, and its objects keep their class name.
- This function runs the three grid converters itself, on the objects: RefactorDbGridTocDbCJGrid for a dbGrid subclass, RefactorDbListTocDbCJGridPromptList for a dbList subclass, and RefactorGridToCJGrid for a Grid subclass. You do not need to select those three, and their parameters are not used: this function tells each of them which class it converts.
- dbGrid becomes cDbCJGrid, dbList becomes cDbCJGridPromptList and Grid becomes cCJGrid, and the Use line of the package is changed to match.
- The class's header label and help text settings (Set Header_Label, Status_Help) move to a new column class in the same package, MyDbGridColumn.
- A class is converted together with all of its objects, or not at all. A class that cannot be converted is not changed, and the run notes explain why.
Group: Modernization
Parameter: "ANY"
Leave it empty to convert every grid subclass the selected files declare. To convert one class only, give its name, e.g. MyDbGrid. The parameters of RefactorDbGridTocDbCJGrid, RefactorDbListTocDbCJGridPromptList and RefactorGridToCJGrid are not used here.
RefactorDbGridTocDbCJGrid
Converts legacy DbGrid objects to a CodeJock grid class, with one column object for each column.
The function's parameter is 'OldGridClass,NewGridClass[,NewColumnClass]'. When it is empty, only DbGrid objects are converted, to cDbCJGrid and cDbCJGridColumn, and objects of workspace subclasses are not changed.
For each DbGrid object found, only the code of that object is changed, never the rest of the file:
- The class is changed to the new grid class.
- The Begin_Row / Entry_Item list becomes one column object for each column.
- Set Form_Width Item N to W becomes Set piWidth to W on each column.
- Set Header_Label Item N to "L" becomes Set psCaption to "L" on each column.
- Grid properties that only the legacy grid has are removed: Main_File, Wrap_State, peResizeColumn and psColumnsID.
- The standard Entry_Display procedure is removed.
- Everything else (other Set lines, objects inside the grid) is kept unchanged.
Group: Modernization
Parameter: "ANY"
Leave EMPTY to convert the plain DbGrid objects to cDbCJGrid with cDbCJGridColumn columns. Objects of workspace subclasses of DbGrid stay as they are: a plain cDbCJGrid would lose what a subclass adds, so port the subclass first. Then name ONE class to convert only that class, as three comma separated class names;
MyDbGrid - Workspace subclass of DbGrid,
MycDbCJGrid - Workspace subclass of cDbCJGrid,
MycDbCJGridColumn - Workspace subclass of cDbCJGridColumn
Fixes compiler message(s): 4537, 4533, 4345, 4328, 4298
RefactorDbListTocDbCJGridPromptList
Converts legacy dbList selection lists to cDbCJGridPromptList prompt lists.
The function's parameter is 'OldListClass,NewGridClass[,NewColumnClass]'. When it is empty, only dbList objects are converted, to cDbCJGridPromptList and cDbCJGridColumn, and objects of workspace subclasses are not changed.
For each dbList object found, only the code of that object is changed, never the rest of the file:
- The class is changed to the new prompt-list class.
- The Begin_Row / Entry_Item list becomes one column object for each column.
- Set Form_Width Item N to W becomes Set piWidth to W on each column.
- Set Header_Label Item N to "L" becomes Set psCaption to "L" on each column.
- A TODO comment is added once, saying that the object that opens the list needs a Prompt_Callback procedure (the peUpdateMode pattern).
- The dbModalPanel around the list, and the object that opens it, are not changed.
Group: Modernization
Parameter: "ANY"
Leave EMPTY to convert the plain dbList objects to cDbCJGridPromptList with cDbCJGridColumn columns. Objects of workspace subclasses of dbList stay as they are: a plain cDbCJGridPromptList would lose what a subclass adds, so port the subclass first. Then name ONE class to convert only that class, as three comma separated class names;
MyDbList - Workspace subclass of DbList,
MycDbCJGridPromptList - Workspace subclass of cDbCJGridPromptList,
MycDbCJGridColumn - Workspace subclass of cDbCJGridColumn
Fixes compiler message(s): 4537, 4533, 4345, 4328, 4298
RefactorGridToCJGrid
Converts legacy Grid objects that are not connected to a database to a CodeJock grid class.
For each Grid object found in the selected files, only the code of that object is changed, never the rest of the file:
- Known properties are changed to their cCJGrid equivalents, and the class is changed to the new grid class.
- Grid properties that only the legacy grid has are removed: Wrap_State, peResizeColumn and psColumnsID.
- The Entry_Display procedure is commented out. Colour settings found in it are converted and placed above the commented-out procedure.
- Methods that only the legacy grid has are commented out, with a TODO comment.
- The columns oCol1..oColN are created from the object's own Set Form_Width and Set Header_Label lines. A grid without columns, which fills itself, is not changed, and a note says so.
The function's parameter is a list of 2 or 3 class names, separated by commas: OldGridClass,NewGridClass[,NewGridColumnClass]
Example: "cMyGrid,cCJGrid,cCJGridColumn"
When the parameter is empty, plain Grid objects are converted to the standard DataFlex classes cCJGrid and cCJGridColumn, and objects of workspace Grid subclasses are not changed.
Group: Modernization
Parameter: "ANY"
Leave EMPTY to convert the plain Grid objects to cCJGrid with cCJGridColumn columns. Objects of workspace subclasses of Grid stay as they are: a plain cCJGrid would lose what a subclass adds, so port the subclass first. Then name ONE class to convert only that class, as three comma separated class names;
MyGrid - Workspace subclass of Grid,
MycCJGrid - Workspace subclass of cCJGrid,
MycCJGridColumn - Workspace subclass of cCJGridColumn
Fixes compiler message(s): 4537
RefactorListToCJGrid
Converts a legacy List (a list of items in one column) to a cCJGrid object, with one cCJGridColumn whose header is hidden.
A method that fills the list with Send Add_Item keeps its name and parameters, because other objects call it, and each Add_Item in it becomes a row of the grid's data. A fixed Item_List / On_Item block becomes a LoadData procedure, which is called when the grid is activated.
Event procedures of the object itself, such as OnChange and Mouse_Up, are kept.
The function's parameter is a list of 2 or 3 class names, separated by commas: OldListClass,NewGridClass[,NewGridColumnClass]
When the parameter is empty, plain List objects are converted to the standard cCJGrid and cCJGridColumn, and objects of workspace List subclasses are not changed.
Group: Modernization
Parameter: "ANY"
Leave EMPTY to convert the plain List objects to cCJGrid with cCJGridColumn columns. Objects of workspace subclasses of List stay as they are: a plain cCJGrid would lose what a subclass adds, so port the subclass first. Then name ONE class to convert only that class, as three comma separated class names;
MyList - Workspace subclass of List,
MycCJGrid - Workspace subclass of cCJGrid,
MycCJGridColumn - Workspace subclass of cCJGridColumn
Fixes compiler message(s): 4537
RestyleDDOs
Changes the names of data dictionary objects to one consistent style.
The naming style of data dictionary objects has changed over time. The current style is:
Object o<tablename>_DD is a c<TableName>Datadictionary
There is also a setting to keep the older style:
Object o<tablename>_DD is a <tablename>_Datadictionary
Before VDF 12, the names looked like this:
Object <tableName>_DD is a <tablename>_Datadictionary
Without the extra 'o', object names clashed with other names in many places. Code copied from old views into new views and dialogs then stops working, and when a workspace mixes styles, the compiler does not report it.
Examples:
<TableName>_DD - o<TableName>DD (eDDStudioStyle)
<TableName>_DD - o<TableName>_dd (neDDNewStyle)
Group: Modernization
Parameter: "eDDStudioStyle, eDDNewStyle, eDDOldStyle"
Default: eDDNewStyle
Valid values; eDDStudioStyle - o<TableName>DD eDDNewStyle - o<TableName>_dd eDDOldStyle - <TableName>_DD