Migration of ProcScript

In Uniface 9, each system trigger was stored in a container with the name of the trigger abbreviation. This implicitly defined the trigger. In Uniface 10, all triggers, operations and entries are stored in a single Script container per object, and must be explicitly defined. The names of many triggers have also changed.

For more information, see Uniface 10: Changes in Triggers.

Note:  In this release, compilation errors may occur in migrated components as a result of changes in the way triggers are inherited. For more information, see Uniface 10: Changes in ProcScript Inheritance and Import and Migration Messages.

Extra Code

When importing object definitions created with an earlier version of Uniface, Uniface migrates all ProcScript modules to the appropriate code containers.

Tip: You can control some aspects of ProcScript migration by setting logicals in the ide.asn file prior to migration. For more information, see Migration Logicals.

To ensure that triggers and other ProcScript modules continue to function as they did in Uniface 9, Uniface adds extra ProcScript instructions during migration:

  • Each trigger is explicitly declared with the trigger or webtrigger statement, using the new trigger name (where applicable). For example, the former Asynchronous Interrupt trigger is now declared as:
    trigger receiveMessage
  • The Execute trigger is now declared as an operation:
    public operation exec
  • An end statement is added to migrated ProcScript modules when required. In some circumstances, this may result in duplicate end statements.

    Reason: Enforcing closure of modules to ensure that any code that follows does not become part of the unclosed module, which would result in changed behavior. During migration, an end statement is inserted when all the following conditions are met:

    • The code is being migrated from Local Proc Modules, Operations, Occurrence Operations, Collection Operations, or Extended Triggers containers.
    • The code starts with a ProcScript fragment, which can be any ProcScript instruction except a module declaration (trigger, operation, entry), an end statement, or a module undeclaration (undeclare)
    • The code of the Uniface 9 container that was migrated immediately before the current one, did not end with an explicit end statement.
    • The MIGRATION_SCRIPT_ADD_END logical in the IDE's assignment file is set to 1 (true).

    Note: In some circumstances, the migration may result in double end statements, which will result in errors during compilation. This could occur, for example, if all Uniface 9 code containers contain a single #include directive, which inserts code that ends with an end statement. To prevent Uniface from automatically adding end statements, set the MIGRATION_SCRIPT_ADD_END logical to 0 (false).

  • The value of the <$triggerAbbr> precompiler constant is explicitly defined for Uniface 9 triggers, if the migrated code contains the <$triggerAbbr> keyword, or #include.

    Reason: The <$triggerAbbr> actually returns the name of the code container. In Uniface 9, the trigger name was the same as the container name, but In Uniface 10, there is usually only one Script container and one Declarations container, so it is of limited value unless it is explicitly defined. For more information, see <$triggerAbbr> and Migrated Trigger Abbreviations.

    Note:  If your code never references <$triggerAbbr>, there is no need to have it defined by the Migration Utility. Use the MIGRATION_TRIGGER_ABBR logical to 0 (false).

  • The new precompiler directives #startdefine and #enddefine are added to migrated Uniface 9 code containers if they contains the command #define or #include. They limit the scope of any compile-time constants declared in the migrated containers. For example:
    #startdefine
    #define $triggerAbbr="receiveMessage"
    trigger receiveMessage
       ...
    end
    #enddefine
    

    Reason: Compile-time constants have container scope. Uniface 10 containers are large and contain all ProcScript modules. For compatibility with Uniface 9 containers, the scope must be explicitly delimited to the same context as Uniface 9 to ensure the behavior remains the same. For more information, see Constants and #startdefine.

Related Topics