LSL 101/Event Handler Parameters

From Second Life Wiki
< LSL 101
Revision as of 11:41, 1 June 2009 by Omei Turnbull (talk | contribs) (New page: Category:LSL 101 {{NavNextPrev|prev=Variable Initialization|next=}} When we previously introduced event handlers, we put off explaining the meaning of what was between the paren...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
← Variable Initialization ↑̲  LSL 101  ̲↑

When we previously introduced event handlers, we put off explaining the meaning of what was between

the parentheses in this line:

<lsl> touch_start( integer num_detected )</lsl>

The time has come when we can easily explain this. The phrase integer num_detected is a declaration

of a local variable.

Consider this script:

default {

    touch_start( integer num_detected )
    {
         // Announce the region where the script is running
         string TextPhrase;
         TextPhrase = "I was just touched " + (string)num_detected  + " time.";
         llOwnerSay(  );
    }

}</lsl>