ScriptModuleEvents Methods



Add(ARef as Object, ACallType as Integer, ACallOperand as Integer) as Integer

Adds new ScriptModuleEvent object to the list and returns index of newly added event in list.

ARef - reference to the function in module (can be obtained via GetRef function, see notes below);
ACallType - see ScriptModuleEvent.CallType;
ACallOperand - see ScriptModuleEvent.CallOperand

Note: name generated automatically as GUID. You can change Name later via ScriptModuleEvent.Name property.

AddEx(ARef as Object, ACallType as Integer, ACallOperand as Integer, AName as String, ADescription as String) as Integer

Same as Add method, but has additional parameters AName and ADescripton.

Note: Name must be unique!

Remove(IndexOrName as Variant)

Removes event from list by Index or Name.

Find(AName as String) as ScriptModuleEvent

Find event with specified name and returns this event.

If event not found - NULL returned (can be checked via IsObject function in script).

Exists(AName as String) as Boolean

Checks if event with specified name exists in list.

Clear

Removes all events from list.

IndexOf(AName as String) as Integer

Returns index of event with specified name. If event not exists - returns (-1).

Exchange(Index1 as Integer, Index2 as Integer)

Exchanges events positions in list.

Move(CurIndex as Integer, NewIndex as Integer)

Moves event with CurIndex to the NewIndex.

 

Note:

       When you add new event with Add or AddEx methods via GetRef function - prototype of your function must be like this (VBScript):

 

       Function ScriptEvent(CallType, Params)

       

       End Function

 

When this function called:

CallType equal to ScriptModuleEvent.CallType

Params depends on ScriptModuleEvent.CallType of event:

8 (before counters resetted) params contains 1-element array. This element contain Rule object.
Other values: params equal to NULL and not used.

Return value ignored at this moment (reserved for future using).