Description: This function sets an event subroutine context for an existing COM client interface.
Returns: Text
Usage: Script
Format: COMEvent(COMClientInterface [, EventSearchScope, EventParent, EventCaller])
Parameters: COMClientInterface { COM client handle } { required } { no default: }
A COM client interface handle returned from a COMClient or ActiveX statement.
EventSearchScope { varies } { optional } { no default: }
An optional parameter which, if present, specifies the scope in which to search for event subroutines, and may be any expression that yields a Module or an object value.
EventParent { object value } { optional } { default: self() }
An optional parameter which, if present, specifies the context that is used to resolve scope for event subroutines, and may be any expression that yields an object value. If absent or Invalid, defaults to Self().
EventCaller { object value } { optional } { default: self() }
An optional parameter which, if present, specifies an "auxiliary" context for event subroutines, and may be any expression that yields an object value. An event subroutine can retrieve this value using Caller(Self()). If absent or Invalid, defaults to Self().
Comments: The COM client interface specified as the first parameter may or may not already have an event subroutine context associated with it. This function supplies a new context that destructively replaces any existing context. Use of this function allows dynamic modification of the event subroutine context. The context may also be dynamically set if the COMClient or ActiveX function is being run in steady state, by simply changing the parameters of the steady-state statement. It is more usual to use this function for COM client interfaces that are created by a script statement.
EventSearchScope specifies the location where the event subroutines for this COM object instance may be found. When an event subroutine is run in response to an incoming event from the object, the parent and caller for the subroutine are as specified by EventParent and EventCaller.
See Also: