Don't click here unless you want to be banned.

LSL Wiki : null

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are ia360925.us.archive.org

Null


Unlike many modern programming languages, LSL lacks an explicit null keyword (variables cannot be assigned null). null is usually used to indicate that the variable holds no value. In LSL, "zero values" are used in its place. Often these values have a meaning equivalant to null when passed to specific functions as parameters or when returned by a function.

Zero Values
Type Literal Constant Description
string "" none empty string
list [] none empty list
integer 0 FALSE* integer zero
float 0.0 none float zero
vector <0.0, 0.0, 0.0> ZERO_VECTOR zero-magnitude vector
rotation <0.0, 0.0, 0.0, 1.0> ZERO_ROTATION identity rotation
key "000000-0000-0000-0000-000000000000" NULL_KEY special reserved key
* Only used in boolean expressions.

Functions

llParseStringKeepNulls


Value | Constant | Functions | Reset
Comments [Hide comments/form]
I think we throw around null too much in its description, [likely incorrectly] assuming readers have knowledge of a programming language outside of LSL (more specificly, with languages that actually use null or something similar to allocate variables without values). The description should be more general, and should (possibly?) emphasize the significance of null in a more specific context (function-by-function?)
-- ChristopherOmega (2006-05-11 18:35:22)
NULL_KEY is technicaly a string. Put it into a list and query the type.
-- BlindWanderer (2006-05-11 21:00:25)
Ugh, what a nusiance implicit typecasting is, espicially when you're using functions that take into consideration element type. That means llListFindList(keyList, [NULL_KEY]) will fail to find any instances of the null key if all the elements of keyList are keys.

Unless... would that be considered a bug?
-- ChristopherOmega (2006-05-12 23:04:31)
should be considered a bug.
-- BlindWanderer (2006-05-19 19:07:28)
I thought it was clearer to label the last row as being type key rather than string (so I changed it). Please correct me if I'm wrong.
-- LulworthBeaumont (2007-06-08 09:42:19)
Attach a comment to this page: