User Tools

Site Tools


dictionary:events:createevent

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
dictionary:events:createevent [2021/02/15 13:23] – added parameter example James Sentmandictionary:events:createevent [2021/02/15 13:26] – [Passing Parameters To A Handler Example] James Sentman
Line 32: Line 32:
  
 ==Passing Parameters To A Handler Example== ==Passing Parameters To A Handler Example==
-if you had a global script named “global test script” with a handler named “doThing” like this:+if you had a global script named “meal manager” with a handler named “mealLogger” like this:
 <code> <code>
-on doThing( theName, theEvent) +on mealLogger( theName, theEvent) 
-    write log theName & “ has “ & theEvent+    write log theName & “ has had “ & theMeal
 end doThing end doThing
 </code> </code>
  
-and created an event such as this:+and then created an event such as this: 
 <code> <code>
-create event “do thing test” that executes script “global test script” handler “doThing parameter {“Jamie”, “Breakfast”} in 10 * minutes+create event “breakfast” that executes script “meal manager” handler “mealLogger" parameter {“Jamie”, “Breakfast”} in 10 * minutes
 </code> </code>
  
 in 10 minutes you would see output in the log like: in 10 minutes you would see output in the log like:
  
-jamie has breakfast+**jamie has had breakfast**
  
  
 ===History:=== ===History:===
 The optional “handler” parameter was added in XTension 9.4.21 The optional “handler” parameter was added in XTension 9.4.21
dictionary/events/createevent.txt · Last modified: 2023/02/13 14:52 by 127.0.0.1