Processes a list so that its contents are of a single-type. These functions have been created and contributed by LSL users to perform operations not covered by built-in LSL functions. Reorder the contents of every stride or reorder entire strides. Moves something in a strided list to another place in the strided list. Here are some additional, user-created functions for working with strided lists: The function llListStatistics can, with care, be used for strided lists as it will silently ignore non integer and non float items. The following three (as of July 2008) native LSL functions can be used with strided lists: Here are the tools we do have for strided lists: It should be noted that when manipulating extremely large strided lists, that if you expect to be editing the lists that you may wish to use one list for each "column", this may be more complex but significantly reduces the amount of memory required when manipulating the lists, though it will be a lot more difficult to sort. To add another person to the above list, you would do this:ĭemographics += If you wish to be able to sort by avatar last name rather than first name, the name should be added to the list in Lastname FirstName format (avoiding a comma, though, of course, unless you wanted LastName and FirstName treated as separate elements in the list.) In other words, if the avatar's rez date were the most important attribute for your script, then you would need to record it first, and the name second. You should consider carefully the order in which you record information because the function to sort a list, llListSort, will only sort on the first element of the instances. It is important that the pieces of information in each grouping are always entered in the same sequence for every instance of the grouping in the list! In the example above, this means that the name needs to be always the first of the three related elements. Index 0 ("John Adams") is the start of the first instance (because list counting starts a 0), index 3 ("Shirley Bassey") is the start of the second instance, and so on. This example has a stride of three, because each grouping (or stride) has three data elements. Lists can be joined simply by using the + sign: If in doubt profile the script with and without using this method. Depending upon the situation (in LSO-LSL) this method may not provide any advantage whatsoever.In Mono-LSL it provides no significant memory advantage or disadvantage. (It helps reduce heap fragmentation, which would otherwise result in unusable blocks of heap memory). Methods 6 & 7 can result in a considerable memory savings in LSO-LSL over methods though there is an LSO-LSL VM bug that causes the string & key typecasts to not stick properly: SVC-1710.Methods 4 & 5 compile to the same thing.Methods 2 & 3 compile to the same thing.As of Method 7 returns the best memory savings in LSO-LSL.Method 1 will consume more memory than other methods in LSO-LSL.Note that prepending the new_item without brackets negates any memory savings in Mono-LSL.Method 1 is the most memory efficient under Mono-LSL.
MyList = (myList = ) + myList + new_item // Recommended for LSO-LSL: appended item with memory fragmentation optimization