SLUDGE

callEvent


Syntax:

callEvent (thisAction, thisObject);

Purpose:

Calls the function specified inside the thisObject objectType definition by the line "event thisAction". Both thisAction and thisObject must be variables of type objectType.

Return value:

TRUE if a function was called. FALSE if no event was found.

Example:

objectType ego () {
}

objectType lookAt () {
}

objectType poster ("poster") {
   event lookAt {
      say (ego, "I'm looking at the poster.");
   }
}

sub init () {
   callEvent (poster, lookAt);
      # Returns FALSE

   callEvent (lookAt, poster);
      # Calls function and returns TRUE
}

See also:

Object Types and Events

fetchEvent