Jump to content

Parsing each character of a string to a list


Guest
 Share

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

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

Recommended Posts

For the sake of being complete with the list of possible solutions, I would like to point to another way of getting arround the parsing that came to my mind. If llHTTPRequest is used with the method GET instead of POST (= posting the information in an html document body instead in an URL) then much longer strings can be transmitted = no need to typecast anything. Downside: The method POST needs more complex PHP scripts = headaches.

Link to comment
Share on other sites

  • 4 weeks later...


Estelle Pienaar wrote:

Maybe there is a way to apply llParseString2List that I have overlooked?

If the data values were in the range [0..7] (upto 8 unique elements) then could use the spacer parameter of llParseString2List. Example:

 

list uniques = ["0","1","2","3","4","5","6","7"]; // one of each unique data elementstring my_string = "7654321001234567";  // some datalist newList = llParseString2List(my_string, [], uniques);

 

If not then looping (stuffing) thru is the simplist

 With looping then if the elements are numerical then from a game runtime pov then is best to cast to integer when stuffing into the list, otherwise they will be stored as strings and each string will be converted to a integer each time the value is called by your game engine (until the value is updated/replaced by a integer). Example of casting:

 

newList += [(integer)llGetSubString(my_string, w, w)];

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2923 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...