omron — Startup Script worksheet

Appendix: VBScript 5. Click the … button in the Script column. Use this interface to execute logics when an ActiveX object triggers an event. Variables declared in this interface are available for this interface only (local scope). In other words, they are not available for any other object in the project. You cannot implement procedures in this interface. You can, however, call procedures implemented in the Global Procedures or in the Screen Script interface for the same screen where the ActiveX object is configured. Note: For more information, see ActiveX Control object . Example:

'The script below will be executed when the Calendar Control ActiveX 'triggers its "AfterUpdate" event $MyYear = CalendarControl1.Year $MyMonth = CalendarControl1.Month $MyDay = CalendarControl1.Day Background Task STARTUP SCRIPT WORKSHEET The Startup Script worksheet is a VBScript interface that is automatically executed when the project is run. To edit the Startup Script worksheet, double-click it in the Project Explorer. (It is located on the Tasks tab, in the Script folder.) The worksheet is displayed: Startup Script worksheet The code configured in this worksheet is executed just once when the Background Task module (BGTask) is started.

This interface is useful for initializing variables or executing logics that must be implemented when the project is run. You can declare and initialize variables and define procedures. However, variables or procedures declared in this interface will be available ONLY to the Script worksheets executed by the Background Task module — they are not available to any VBScript interface from the Graphic Module. Example: 'Variables available for all Script groups from the Script task can be declared and initialized here Dim MyVar, Counter MyVar = 100 'Procedures available for all Script groups from the Script task can be implemented here InduSoft Web Studio Page 649