Type: | Module | Parent Module: | N/A |
This module will fix the problem associated with use of library variables and multiple libraries. Omnis 7 library variables are converted by the built-in core converter in Studio to task variables that have a different scope. To correct this in a situation where an application comprises more than one library using this converter module the developer must nominate a master library. Other libraries are then regarded by this module as children of the master library. All task variable definitions are copied from the child libraries to the master library. Since there is only a single Startup_Task instance all these variables effectively become global variables that are available to all instances.
Warning. This behaviour is different from that of the original library variables in Omnis 7. It is however the nearest type of behaviour exhibited by a variable in Omnis Studio, other than using memory only file classes and should give satisfactory results, except where the multiple libraries are expecting to be able to maintain different values in library variables that have the same names as those in the other libraries. If this does not suit your requirements then you need to go back to Omnis 7 and rename the library variables so that they have different names in each library before converting to Studio.
The converted system must be run in such a way that the master library is opened first and is resposible for instantiating classes in all libraries. This will ensure that the correct task variables are always in scope.
Before running the Converter the developer must first select the master library that will eventually contain all the task variable definitions. See User Setup Required for this Module below for instructions on how to do this.
Check if the master library is open. If not attempt to open it. If unable to open it then display an error.
Check if the libary being propessed is not the master library then copy all task variable definitions to the master library as follows:
Note that when a task variable has been removed from the source library then all references to a task variable MyVar will automatically be replaced by Studio with $ctask.MyVar and consequently the reference will be correctly evaluated at run-time to a reference to the variable in the owning task instance that exists in the master libary. This is the reason why it is important that the master library is the controlling library for the system and that its task instance owns all instances of other classes from all libraries.
Before running the Converter the developer must first select the master library that will eventually contain all the task variable definitions. To do this: