Unofficial LSL reference

User Tools

Login

You are currently not logged in! Enter your authentication credentials below to log in. You need to have cookies enabled to log in.

Login

Forgotten your password? Get a new one: Set new password

Differences

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

Link to this comparison view

types:key [2015-09-22 09:50 SLT]
sei Elaborate on the examples
types:key [2015-09-22 10:23 SLT] (current)
sei fix link
Line 20: Line 20:
 Type conversion between $ty[string] and $ty[key] happens automatically in most cases. One exception is the string concatenation operator (+). When concatenating a key to a string, the key has to be typecast to string first by prefixing it with ''​(string)''​. See examples below. Type conversion between $ty[string] and $ty[key] happens automatically in most cases. One exception is the string concatenation operator (+). When concatenating a key to a string, the key has to be typecast to string first by prefixing it with ''​(string)''​. See examples below.
  
-There is no syntax to specify a key-typed literal; keys need to be type cast from string by using the ''​(key)''​ prefix. Even the predefined [[contants/]] that hold UUIDs are not of type ''​key'',​ but ''​string''​. This is mostly relevant when storing keys in a $lty[list], because the elements need the correct type when used with functions such as $lfn[llListFindList] or $lfn[llGetListEntryType]. In particular, this bars the possibility of initializing a list with a key literal in the globals section of a script, because type casts are not allowed there. The only possibility to include a key element inside a list in the globals section is to define a key-typed variable first and use it in the list. See examples below.+There is no syntax to specify a key-typed literal; keys need to be type cast from string by using the ''​(key)''​ prefix. Even the predefined ​$lct[] that hold UUIDs are not of type ''​key'',​ but ''​string''​. This is mostly relevant when storing keys in a $lty[list], because the elements need the correct type when used with functions such as $lfn[llListFindList] or $lfn[llGetListEntryType]. In particular, this bars the possibility of initializing a list with a key literal in the globals section of a script, because type casts are not allowed there. The only possibility to include a key element inside a list in the globals section is to define a key-typed variable first and use it in the list. See examples below.
  
 === Additional notes === === Additional notes ===