EnhEvent.Opcode

[This is preliminary documentation and subject to change.]

The Opcode property describes the operation type of a microevent. For example, whether it is a file download or trigger.

Syntax

object.Opcode(index) [ = iVal ] 
 

Parts

object
Object expression that resolves to an EnhEvent object.
index
Long that indicates the 0-based index of the microevent. This value must always be less than or equal to EnhEvent.AttrCount. If you set index to a value higher than EnhEvent.AttrCount, Opcode returns -1.
iVal
Integer that specifies the operation type. This can be one of the following identifiers:
Opcode Description
EVOPannouncement The microevent sends an enhancement announcement.
EVOPdelannc The microevent is a delete announcement which rescinds a previously transmitted announcement.
EVOPdownload The microevent downloads a file.
EVOPglobal The microevent sets a global variable.

This functionality is not implemented in the current version of Broadcast Architecture.

EVOPinclude The microevent includes a stream into the current stream.
EVOPtrigger The microevent sends a trigger.
EVOPuserdef The microevent is user-defined.
EVOPgroup The microevent is one of a group of dependent files.

Remarks

The text of the microevents described by Opcode can be accessed using EnhEvent.Attr. For example, e.Opcode(0) returns the operation type of the microevent accessed by e.Attr(0). Because there is a one-to-one relationship between Opcode and EnhEvent.Attr, EnhEvent.AttrCount, which enumerates the number of microevents, also enumerates the number of property types stored in Opcode.

You can use Opcode to add microevents to an event. Simply set either the text or the operation type for the microevent at the AttrCount index. This is demonstrated in the following example:

index = e.AttrCount
 
'Add a new file download microevent to an event.
'Note that this increments AttrCount.
e.Opcode(index) = EVOPdownload
 
'Identify the text of the microevent
e.Attr(index) = "File1.htm"
 

You can only add one microevent at a time, attempting to set microevent values at indices higher than AttrCount results in a CTL_E_INVALIDPROPERTYVAL error.

QuickInfo

  Windows NT: Unsupported.
  Windows: Requires Windows 98.
  Windows CE: Unsupported.
  Header: Declared in stream.idl.
  Import Library: Included as a resource in stream.dll.
  Unicode: Yes.

See Also

EnhEvent.Attr, EnhEvent.AttrCount

Examples

You can use Opcode to either determine or set the type of a microevent. The following example counts the number of trigger microevents in an event.

For item = 0 to (e.AttrCount - 1)
  If e.Opcode(item) = EVOPtrigger Then
    numTrigger = numTrigger +1
  End If
Next item
 

If you want to set or change the type of a microevent, you typically need to set both the microevent text, available from EnhEvent.Attr, and the Opcode value. The following example changes the third microevent of an event to a announcement.

e.Attr(2) = "MyAnnc.ann"
e.Opcode(2) = EVOPannounce
 

Note that if you do not set the corresponding Attr property in the preceding example, the syntax of the new trigger microevent is incorrect.