Type: | Submodule | Parent Module: | ModuleCMethods |
The Open window instance command behaves differently to the Omnis 7 Open window command. Whereas the old Open window command opened a single instance of a window or, if the window was already open caused it to come to top, the Omnis Studio command Open window instance will attempt to open a new instance of a window class each time it is executed. Since the converted command uses the class name to name the instance this will cause a run-time error in Omnis Studio if the command is executed twice without closing the first instance. This sub-module resolves this by converting the Open window instance command to a command which only open a single instance of the window class.
Search for commands containing "Open window instance".
The Open window instance command is checked to determine whether it positions the open window using the parameters Top, Left, Height or Width. If so then the code is modified as follows:
If the original Open window instance command does not use the parameters Top, Left, Height or Width then the code is modified as follows:
In this way only a single instance of each window class is opened.