Difference between revisions of "LlGetListLength"
Jump to navigation
Jump to search
Line 10: | Line 10: | ||
|examples | |examples | ||
|helpers | |helpers | ||
|also_functions | |also_functions={{LSL DefineRow||[[llListStatistics]]|[[LIST_STAT_NUM_COUNT]]}} | ||
|also_events | |also_events | ||
|also_tests | |also_tests | ||
|also_articles | |also_articles | ||
|notes | |notes=An easier and faster way to determine the length of a script is to do a not-equals compare with a null list. This works because the list not-equals compare returns the difference between the lengths. | ||
<pre> | |||
list in; | |||
integer len_in = llGetListLength(in); | |||
integer flen_in = (in != []); | |||
//flen_in and len_in will be the same | |||
integer neg_len_in = -llGetListLength(in); | |||
integer fneg_len_in = ([] != in); | |||
//flen_in and len_in will be the same | |||
</pre> | |||
Locations: | |||
'linden\indra\lscript\lscript_library\lscript_alloc.cpp' @ lsa_cmp_lists | |||
'linden\indra\lscript\lscript_execute\lscript_execute.cpp' @ list_list_operation | |||
|permission | |permission | ||
| | |location | ||
|cat1=List | |cat1=List | ||
|cat2 | |cat2 |
Revision as of 20:18, 2 March 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: integer llGetListLength( list src );185 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns an integer that is the number of elements in the list src.
• list | src |
Caveats
Examples
Notes
An easier and faster way to determine the length of a script is to do a not-equals compare with a null list. This works because the list not-equals compare returns the difference between the lengths.
list in; integer len_in = llGetListLength(in); integer flen_in = (in != []); //flen_in and len_in will be the same integer neg_len_in = -llGetListLength(in); integer fneg_len_in = ([] != in); //flen_in and len_in will be the same
Locations: 'linden\indra\lscript\lscript_library\lscript_alloc.cpp' @ lsa_cmp_lists 'linden\indra\lscript\lscript_execute\lscript_execute.cpp' @ list_list_operation
See Also
Functions
• | llListStatistics | – | LIST_STAT_NUM_COUNT |