ReplaceFormDefScannerSettings: Example

This example shows how to use ReplaceFormDefScannerSettings to modify the scanner settings of a form definition from a user-defined menu.

Important: Read the warning in ReplaceFormDefScannerSettings before using that method.

  1. Export the form definitions from the old FORMS installation.

  2. Install the new version of FORMS.

  3. Using Manager, add this code to the AppStart event to add a user-defined menu:

    Function OnAppStart () As Long

        ret= ManagerApp.AddMenuItem (ehUserDefinedMenu2,

    "FormDef.UpdateScannerSettings", 0, 1, 1)

        OnAppStart = EV_OK ' Return value to FORMS

    End Function

  4. Add the corresponding VB code to modify the scanner settings:

    Function OnAppUserDefined2 () As Long

        ‘Replacing form definitions scanner setting with current scanner settings"

        Application.ReplaceFormDefScannerSettings()

        OnAppUserDefined2 = EV_OK ' Return value to FORMS

    End Function

  5. Restart Manager.

  6. Import the form definitions.

  7. Modify the scanner settings to the desired values.

  8. Modify each form definition using this procedure:

    1. Open the form definition.

    2. Select the user-defined command. The form definition’s scanner settings are replaced with the ones you defined in step 7 above.

    3. Save the form definition.

Example of another way of doing the same thing

Exporting definitions and tables (FORMS Help topic)

Importing definitions and tables (FORMS Help topic)