Occurs when a program is about to run.
Object.OnInitProgram()
The OnInitProgram event syntax has the following parts:
Name |
Type |
Description |
Object |
ASystem, ADriver |
Module object |
The OnInitProgram events apply to the Driver and System modules. ATEasy will call first the System OnInitProgram event (if exist) then the System Drivers (if exist in your project). For each program that is executed ATEasy will run the OnInitProgram and then call the program OnInit event. If the event procedure does not contain code then ATEasy will not call the event.
The following list shows the order of OnInitProgram events combined with default output (see ModuleEvents.prj example for more information). After the last OnInitProgram is called, ATEasy will output the program header to the log as shown here. The log output can be override to create custom output using SetLogString function:
* System.OnInit
* Driver1.OnInit
* Driver2.OnInit
* System.OnInitSystem
ATEasy Test Log.
----------------
Company... :
User name. : RonnieY
Project... : ModuleEvents
Version... : 1 (Wed Oct 26 05 18:43:29)
* System.OnInitSwitchUut
* Driver1.OnInitSwitchUut
* Driver2.OnInitSwitchUut
* Program.OnInitSwitchUut
* System.OnInitProgram
* Driver1.OnInitProgram
.\ModuleEvents.prg
* Driver2.OnInitProgram
.\ModuleEvents.prg
* Program.OnInit
================================================================================
Program... : Example
UUT....... :
Version... : 1 (Fri Nov 05 10 08:52:27)
Serial #.. :
Start time : 11/8/2010 4:25:12 PM
* System.OnInitTask
Use the OnInitProgram events to initialize the specific module before a program is executed. If the event returned normally (not ignored) ATEasy will continue to call all the OnInitProgram events for other modules.
The following is an example of one way to use the OnInitProgram event:
System.OnInitProgram()
{
! ... system initialization code ...
print "System has been initialized before execution of program "; Program.Name
}
OnEndProgram, OnInit, OnInitSystem, OnInitTask, OnInitTest, Run Statement, Initialization Events, About Module Events