Difference between revisions of "LlDetermineType"

From Second Life Wiki
Jump to navigation Jump to search
Line 29: Line 29:
|spec
|spec
|caveats
|caveats
|examples=<pre>
|examples=
<pre>
<lsl>
default
default
{
{
Line 36: Line 38:
         llListen(0,"",llGetOwner(),"");
         llListen(0,"",llGetOwner(),"");
     }
     }
     listen(integer chan, string name, key id, string msg){if(llDetermineType(msg,0,-1)==1){integer new_number=msg;}}}</pre>
     listen(integer chan, string name, key id, string msg)
    {
        if(llDetermineType(msg,0,-1)==1)
        {
            integer new_number=msg;  
        }
    }  
}
</lsl>
</pre>
|helpers
|helpers
|related
|related

Revision as of 21:11, 4 May 2009

integer llDetermineType(string source, integer start, integer end);
if(llDetermineType(msg,0,-1)==1)
{
    integer new_number = msg;
    //llDetermineType determines the type of a part of a string and returns the result. In this istance, returning 1 will indicate that it is an integer instead of a key or rotation.
}
Emblem-important-yellow.png LSL Feature Request
The described function does not exist. This article is a feature request.

Summary

Function: integer llDetermineType( string source, integer start, integer end );
REQUEST Function ID
0.0 Forced Delay
10.0 Energy

Returns an integer to represent the type of the part of the string.

• string source The string that you are determining the type of a part of.
• integer start The start point in the string of what you are determining.
• integer end The end point in the string of what you are determining.

number does not support negative indexes.

Caveats

  • If number is out of bounds the script continues to execute without an error message.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>
default
{
    state_entry()
    {
        llListen(0,"",llGetOwner(),"");
    }
    listen(integer chan, string name, key id, string msg)
    {
        if(llDetermineType(msg,0,-1)==1)
        {
            integer new_number=msg;   
        }
    }    
}
</lsl>

Notes

Should make it easier for scripters to determine the types of parts of strings in order to get accurate results as opposed to manually deriving them from the string.

Deep Notes

Search JIRA for related Issues

Signature

//function integer llDetermineType( string source, integer start, integer end );