Difference between revisions of "User:SignpostMarv Martin/Sandbox/LSL/types"
Jump to navigation
Jump to search
m (→Examples: oops) |
m (→See Also) |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
* LSL strings support [http://en.wikipedia.org/wiki/UTF-8 UTF-8 characters]. | * LSL strings support [http://en.wikipedia.org/wiki/UTF-8 UTF-8 characters]. | ||
* LSL string variables are limited to the amount of free [[LSL#memory|memory]] available to the script. | * LSL string variables are limited to the amount of free [[LSL#memory|memory]] available to the script. | ||
* Other data types can be [[typecast]] into a string for use with [[llHTTPRequest() | * Other data types can be [[typecast]] into a string for use with [[llHTTPRequest]](), [[llMessageLinked]] etc. | ||
* The results of any communication operation that returns a string ([[listen]], [[link_message]], [[http_response]], [[dataserver]]) can be [[typecast]] into the required data type. | * The results of any communication operation that returns a string ([[listen]], [[link_message]], [[http_response]], [[dataserver]]) can be [[typecast]] into the required data type. | ||
=== key === | === key === | ||
Line 36: | Line 35: | ||
== See Also == | == See Also == | ||
* [[ | * [[String]] | ||
* [[UUID]] | * [[UUID]] | ||
* [[Hexadecimal]] | * [[Hexadecimal]] |
Latest revision as of 12:51, 14 November 2007
String types
string
- LSL strings support UTF-8 characters.
- LSL string variables are limited to the amount of free memory available to the script.
- Other data types can be typecast into a string for use with llHTTPRequest(), llMessageLinked etc.
- The results of any communication operation that returns a string (listen, link_message, http_response, dataserver) can be typecast into the required data type.
key
- Key is the data type used to store UUID
- Although Second Life UUIDs adhere to a specific standard, the key data type itself can store any valid string.
Numeric types
float
- LSL Floats adhere to the IEEE 754 standard for floating point numbers.
integer
- In LSL, integers are 32-bit values ranging from -2147483648 to 2147483647.
- LSL does not have an unsigned integer type (which would allow for values between 0 and 4294967295)
- Integers can either be entered in decimal or hexadecimal
Examples
- integer foo = 10;
- integer bar = 0xa; // returns 10
- float bah = 10.0;
- integer foo = (integer)16.4; // returns 16
- float bar = 16.4;