Studio Characteristics and Behavior (Magic xpa 3.x)
The Main Program will always be listed as the first program in the Program repository. It is automatically generated whenever a new project is created, and its default name will be Main Program.
You cannot delete, repeat, overwrite, or execute the Main Program.
The Main Program's Task Properties dialog box has the following settings:
-
The Task Type is set to Batch, and is disabled.
-
The Initial Mode is set to Query, and is disabled.
-
The End Task condition is set to No.
-
The Allow Events property is set to No and is disabled.
-
Because the Main Program does not have a Main Source, the related properties will be disabled.
-
All properties in the Advanced tab of the Task Properties dialog box will be disabled, except for the Main Display property, which is set to 0.
-
In the Data tab, the Locking Strategy property is set to No Lock and is disabled. All of the other properties are also disabled.
The program is created by default with a class 0 form. You can always add a form, but this form will not have a system menu. Forms of a class greater than 0 are available for output for all the project’s programs.
The Main Program does not have I/Os. The I/O Device repository is therefore disabled.
The Main Program supports the Task Prefix and Task Suffix logic units. The Record Prefix and Record Suffix logic units are not supported for the Main Program. Any other user-defined logic unit can be set to be used throughout the project.
Task Prefix – The Task Prefix logic unit of the Main Program acts as the prefix phase for the entire project. Use this logic unit to define any operation you wish to perform for the initialization phase of the project.
You can initialize the Main Program’s global variables using the Update operation, or call its initialization programs using the Call operation or any other relevant operation.
Task Suffix – Similar to the Main Program’s Task Prefix, the Task Suffix logic unit can be considered as the suffix phase of the entire project. You can use this logic unit to define any operation you wish to perform for the termination phase of the project.
The Main Program’s variables are available for all programs in the project. In the Variable list they appear before any other program’s variables and will be listed alphabetically. The variable names consist of 3 characters. When a variable is selected, its name is displayed.
Because the Main Program’s variables are used throughout the project, Version Control regards it as a separate entity, thus allowing for shared access. Modification of the Main Program resources can only be done exclusively – as is the case of data sources and programs.
Whenever an object that uses the Main Program is being edited, the Main Program cannot be checked in. If you then try to check in the Main Program, the “Main Program already locked” error message appears.
The Main Program is not available for Call operations – you cannot explicitly call the Main Program.