EnhEvent.Depend

[This is preliminary documentation and subject to change.]

The Depend property contains an array of strings containing the path and filenames of the event's dependencies.

Syntax

object.Depend(lIndex) [ = sDepend ]
 

Parts

object
Object expression that resolves to an EnhEvent object.
lIndex
Long that specifies the index of the dependency within the array.
sDepend
String that specifies the path and filename of the dependency file at lIndex. If you set sDepend to an empty string ("") the file is removed from the event's dependency list, and the remaining values are re-indexed.

Remarks

You can use Depend to retrieve or set dependency files for an event. With it, your authoring tool can either use the dependency list automatically generated by the stream compiler objects or create a custom dependency list for the event.

If the dependency list for an event is empty, the stream compiler objects automatically calculate the dependencies for that event when the event or stream is converted to low-level format by EnhEvent.Flatten or EnhEvents.Flatten. If a dependency list already exists for the event, the stream compiler objects do not generate a new dependency list. Instead, they use the pre-existing dependency list.

To force the stream compiler objects to re-calculate dependencies for an event, you can use Depend to delete all of the items in the dependency list. Simply set the value of each item to an empty string (""). This is illustrated in the Examples section at the end of this topic.

Similarly, you can prevent the stream compiler objects from automatically calculating dependencies for an event, by creating a dependency list using Depend.

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.DependCount, EnhEvent.Flatten, EnhEvent.UnFlatten, Editing the Dependencies of an Event

Examples

The following example deletes all of the items in an event's dependency list.

While e.DependCount > 0
    e.Depend(0) = ""
Wend
 

Note that in the preceding example, the 0th element of the array is always the one removed. Because the remaining dependencies are re-indexed each time a dependency is deleted, you cannot replace the second line with:

e.Depend(i) = ""
 

Because it would cause the loop to overrun the array.

The following example sets a dependency list for the event e.

e.Depend(0) = "First.gif"
e.Depend(1) = "Second.gif"
e.Depend(2) = "Third.jpg"
 

Because DependCount is incremented each time a dependency file is added to the list, the preceding example can also be written as:

e.Depend(e.DependCount) = "First.gif"
e.Depend(e.DependCount) = "Second.gif"
e.Depend(e.DependCount) = "Third.jpg"
 

Note that, as with EnhEvent.Attr, you cannot add more than one dependency at a time, and only to the end of the array. In other words, you can only add a dependency whose index value is equal to DependCount.