Two new methods were added to Elipse E3 version 5.6: RunEvent and RunProcedure. The goal of these new methods is to run an object’s scripts, procedures, or functions at random, that is, at no pre-established order.
Check below for the description of how to use both methods (RunEvent and RunProcedure) individually in Elipse E3, as well as for examples of how to apply them.
RunEvent(EventName, [Arguments])
This method executes the script(s) associated to the event indicated by EventName parameter, which must then be a string. The Arguments parameter is optional, and you should only use it when the event requires arguments. Separate these arguments by commas.
NOTE: This method will fail if the indicated event has no script for execution.
Example 1:
Sub CommandButton1_Click() Screen.Item("CommandButton3").RunEvent "Click" End Sub
Script at CommandButton3’s Click event:
Sub CommandButton3_Click() msgbox "Evento Click - Objeto:" & name End Sub
Example 2:
Sub CommandButton4_Click() Application.GetObject("Dados1.TagInterno1").RunEvent "TraceEvent" End Sub
Script at TagInterno1’s TraceEvent event:
Sub TagInterno1_TraceEvent() Application.Trace "Evento disparado" End Sub
RunProcedure(ProcedureName, [Arguments])
This method execute the script(s) associated to the procedure or function indicated by ProcedureName parameter, which therefore must be a String. The Arguments parameter is optional, and you should only use it in cases where the procedure or function requires arguments. Separate these arguments by commas.
NOTE: This method will fail if the indicated procedure or function has no script for execution. Likewise, this method will return value in cases when the function indicated by ProcedureName parameter also returns value.
Example:
Sub CommandButton1_Click() msgbox Screen.Item("CommandButton2").RunProcedure("Soma1",6,6) End Sub
Script containing a function at CommandButton2:
Sub CommandButton2_Click() End Sub Function Soma1(R,U) Soma1 = R+U End Function Sub Vazia() End Sub
For further information on how to use scripts with the Elipse E3 platform, check out the scripts section at our KnowledgeBase.