ID Numbers

Each event is uniquely identified by an ID number between 0 and maxEvents-1. When an event is removed with the RemoveEvent or ClearAllEvent function, the ID number of the event is freed and may be assigned to new events that are later defined.

Whenever a new event is defined with the SetEvent function, the smallest unused ID number is assigned to the event. The assigned ID number is returned by a pointer argument to this function.

An overloaded SetEvent function allows a requested ID number to be specified. This function will assign the requested ID number to the new event if it is assigned to no other event, and will return an error if the ID number is already assigned to another event.

Event functions reference events using the ID number. The GetAllEventID function returns the ID numbers of all defined events.

Execution Order

Events are executed each cycle in ascending order of the ID number. If certain events trigger based on the results of other events, the events whose results should be generated first should be defined first to reduce delays in the events triggering.