Difference between revisions of "User:SignpostMarv Martin/Sandbox/LSL/types"

From Second Life Wiki
Jump to navigation Jump to search
(padded)
 
(2 intermediate revisions by 2 users 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()]], [[llMessageLinked]] etc.
* 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 28: Line 27:
#integer foo = (integer)16.4; // returns 16
#integer foo = (integer)16.4; // returns 16
#float bar = 16.4;
#float bar = 16.4;
#float bah = 0xf.4; // returns 16.4


== vector ==
== vector ==
Line 37: Line 35:


== See Also ==
== See Also ==
* [[Strings]]
* [[String]]
* [[UUID]]
* [[UUID]]
* [[Hexadecimal]]
* [[Hexadecimal]]

Latest revision as of 12:51, 14 November 2007

String types

string

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

  1. integer foo = 10;
  2. integer bar = 0xa; // returns 10
  3. float bah = 10.0;
  1. integer foo = (integer)16.4; // returns 16
  2. float bar = 16.4;

vector

rotation

list

See Also