EnhEvent.Attr

[This is preliminary documentation and subject to change.]

The Attr property is an array of text of the subevents, or microevents stored within an event. The operation codes of these subevents are stored in the EnhEvent.Opcode array.

Syntax

object.Attr(index) [ = sAttr ] 
 

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, Attr returns an error.
sAttr
String that receives the microevent string. The content of this string depends on the type of microevent. The type of microevent is stored in EnhEvent.Opcode.
Microevent Type sAttr contains
Announcement Announcement filename.
Delete Announcement Announcement filename.
Download Path and filename of the file.
Global Assignment of the global variable.
Include Stream filename.
Trigger Trigger data.
User-defined User-defined text.
Group Handle and positioning information used to unflatten events converted into low-level syntax. The data is formatted as "HandleAsLong[,head]" where HandleAsLong is the original event's handle expressed as a Long. The optional keyword head identifies the original high-level event.

Remarks

Each event can contain one or more microevents. For example, the event set by the following code has three microevents, downloading File1.htm, triggering File2.htm to be displayed in the Left frame, and a comment.

evs.AddText("0:32.0 {File1.htm trigger(2 <File2.htm>[targ:Left]) userdef ""This is a comment"" };")
 

You can use Attr 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.Attr(index) = "File1.htm"
 
'Identify the type of microevent operation
e.Opcode(index) = EVOPdownload
 

For each microevent that you add, you must also specify an operation type such as a trigger, download, or user comment. To do this, set EnhEvent.Opcode at the same index as the new microevent. This is demonstrated in the preceding example.

You can only add one microevent at a time, attempting to set microevent values at indices higher than AttrCount results in an CTL_E_INVALID_PROPERTYVAL 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.AttrCount, EnhEvent.Opcode

Examples

You could access the text of the three microevents programmatically by using the Attr collection. For example, if you set an event such as the one described in the Remarks section, then the following code

Open "MyFile.txt" for Output As #1
Write #1, "Index,"+Chr$(9)+"Opcode,"+Chr$(9)+"Attr"
 
For item = 0 to (e.AttrCount - 1)
  Select Case e.Opcode(item)
  Case EVOPdownload
    Write #1, item, "Chr$(9)+EVOPdownload", Chr$(9)+e.Attr(item)
  Case EVOPtrigger
    Write #1, item, "Chr$(9)+EVOPtrigger", Chr$(9)+e.Attr(item)
  Case EVOPuserdef
    Write #1, item, "Chr$(9)+EVOPuserdef", Chr$(9)+e.Attr(item)
  End Select
Next item 
 
Close #1
 

writes the following output to MyFile.txt

"Index,  Opcode,       Attr"
 0,      EVOPuserdef,  "This is a comment"
 1,      EVOPtrigger,  "<File2.htm>[targ:Left]"
 2,      EVOPdownload, "File1.htm"
 

You can use Attr to set or change microevents. For example, the following code changes the file that is downloaded from File1.htm to File3.htm.

e.Attr(2) = "File3.htm"
 

To change the type of the event, such as from a file download to a trigger, change the corresponding value of EnhEvent.Opcode. For example, the following code changes the preceding microevent, Attr(2), into an announcement.

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

If you did not set Opcode to EVOPannounce in the preceding example, the microevent would still be an FTS download and would download the file MyAnnc.ann instead of sending it as an announcement.