Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Strided Lists: My Function Wish List

Rock Ryder
Registered User
Join date: 6 Oct 2006
Posts: 384
11-20-2007 04:35
Hi guys,

I have been playing with strided lists in connection with my sim prim scanner, and I have tried those 7 excellent strided List functions written by AakanaarLaSalle and posted in this forum and on the Wiki:

Stride Count: Number of strides in a list
Find Stride: Search a list for an item, and return the stride and element position of item
Delete Stride: deletes a stride from a list
Get Stride: returns a single stride from a list
Replace Stride: replaces a stride with another
Get Element: Locate and return an element within a strided list
Replace Element: Locate and replace an element within a strided list

Very useful indeed. But is there anyone out there who could step up to the plate and provide any of the following strided functions (for the good of mankind, and particularly me) from my wish list?

1. Find Stride Length: Returns the number of elements in a stride
2. Delete Stride Element: Delete an element from every stride
3. Add Stride Elements: Increase the number of elements in a stride by one or more
4. Replace Stride Element: Find a stride based on one element, but replace a different element within the same stride.

In case anyone is unfamiliar with strides, some definitions are in order:

STRIDED LISTS
A strided list is a way of putting lists within a list. For example, you could have an adress book composed of 3 lists, containing Names, Addresses, Telephone Numbers. Each element in these lists would relate to the the elements in the other lists by their index number.

A strided list is a single list, containing the same elements as in the separate lists, but in this format:["Name1", "Address1", "Phone1", "Name2", "Address2", "Phone2", ..... "NameN", "AddressN", "PhoneN"]

A stride is one set of parameters or elements, ie the name, address and phone number. The number of strides in the list is N, and the stride length is the number of elements within the stride, ie 3 (for the name, the address and the phone number).

Now, suppose you want to confirm that any manipulations you have made on a list have maintained its strided integrity, particularly when you have sent the list via a linked message to another script, converting first to strings then back to the original data type. Examining the data in the list, and noting that there is a fixed pattern, such as key, string, integer; key, string, integer; might be one way, any others? Wish list item 1.

And suppose you wish to get rid of a particular piece of info, such as the phone number, and reduce your strided list from having a stride length of 3 to 2? Wish list item 2.

Or, conversely, suppose you wanted to add a 4th element, such as email address to your address book strided list? Or more than one extra elements? Wish list item 3.

And suppose you get a new telephone number for someone, but you can only remember the person's name? Simple, you search on name and that will take you to the correct stride, then you replace, not the name, as in the library example, but the phone number element within that stride. Wish list item 4.

Who wants to be on my Christmas Card list? (no pun intended) :-)

Rock
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
11-20-2007 05:25
Nice list, Rock :)

... I actually have only 1 Wish on my list, when I think of «lists»: I want arrays! real, working arrays, with keys and values and the ability to put an array into an array (thus getting rid of «strided lists»)...

:)