Difference between revisions of "NULL KEY"
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
|desc=While technically a string constant, it is only useful as a [[key]]. | |desc=While technically a string constant, it is only useful as a [[key]]. | ||
Despite fitting the syntax criteria to be a valid [[key]], when fed to a {{LSLGC|Conditional}} it executes as false. | Despite fitting the syntax criteria to be a valid [[key]], when fed to a {{LSLGC|Conditional}} as a key it executes as false. | ||
|examples | |||
In most applications NULL_KEY isn't needed and an empty string will suffice. | |||
Like any string constants longer then 4 characters and used in multiple places in the code, they should be store in a global variable. The result will be a considerable memory savings. | |||
|examples=<pre> | |||
integer isKey(key in) { | |||
if(in) return 2; | |||
return (in == NULL_KEY); | |||
}//returns 2 if it's a valid key, 1 if it's NULL_KEY | |||
</pre> | |||
|notes=test | |||
|functions= | |functions= | ||
{{LSL DefineRow||[[llAvatarOnSitTarget]]|}} | {{LSL DefineRow||[[llAvatarOnSitTarget]]|}} |
Revision as of 19:02, 15 August 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Description
Constant: string NULL_KEY = "00000000-0000-0000-0000-000000000000";The string constant NULL_KEY has the value "00000000-0000-0000-0000-000000000000"
While technically a string constant, it is only useful as a key.
Despite fitting the syntax criteria to be a valid key, when fed to a Conditional as a key it executes as false.
In most applications NULL_KEY isn't needed and an empty string will suffice.
Like any string constants longer then 4 characters and used in multiple places in the code, they should be store in a global variable. The result will be a considerable memory savings.
Caveats
Related Articles
Functions
• | llAvatarOnSitTarget | |||
• | llDetectedKey | |||
• | llGetNotecardLine | |||
• | llGetLandOwnerAt | |||
• | llGetPermissionsKey | |||
• | llGetTexture | |||
• | llListen |
Events
• | attach |
Examples
integer isKey(key in) { if(in) return 2; return (in == NULL_KEY); }//returns 2 if it's a valid key, 1 if it's NULL_KEY
Notes
test