Jump to content

Manipulating lists through a function


SubZeroWins
 Share

You are about to reply to a thread that has been inactive for 2250 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Multiple possible solutions.

-----------
Strided lists will of course help here to manage multiple lists in one.

-----------
Another way is to add markers to the list. Example:
list data = ["@1","1","2","3","@2","3","4","5","@3", ..... ,"@21"];

You call your function with parameter index=2 for example and do:
integer start = llListFindList(data,["@"+(string)index]) + 1;
integer end = llListFindList(data,["@"+(string)(index+1)]) - 1;

you find your list elements from start to end in the data list

-----------
Another way is to store separated strings in lists. Example:
list data = ["1|2|3","4|5|6","7|8|9" .... ];

You call your function with parameter index=2 for example and do:
list sublist = llParseStringKeepNulls(llList2List(data,index,index),["|"],[]);

your list elements are in sublist

-----------
If the sublists have all the same length a simple calculation gives you the index of the sublist

 

The best solution depends on the circumstances and details of your application

Edited by Nova Convair
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2250 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...