TriggerEventAndWait

Purpose

This function forces an event to be triggered and does not return until the event has completed.

Parameters

Parameter: name
Type: string
Description: This is the name of the event you want to trigger.  The actions for the event are executed.  Note that the name is not case-sensitive.  For instance, the events "Evening" and "evening" would be considered the same.  

Returns

Return value: status
Type: integer
Description: This is 0 if there was an error or 1 if there was no error.  If an error is detected, then an error message is written to the event log.

Example

Trigger the event named "turn all lights on" using a VB.NET script.

Sub Main(ByVal Parms as Object)

iReturn = hs.TriggerEventAndWait("turn all lights on")
If iReturn = 0 Then
   hs.WriteLog("Error","There was an error triggering the event: Turn All Lights On")
End If

End Sub