Jump to content

Help with list creation, sort of


Shades Babad
 Share

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

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

Recommended Posts

Hello, very sorry if this is a simple answer as it has perplexed myself and a few other scripters I have presented it to. I am workign ona  slide show that is fed by information derived from  database.  Currently I have it working so that it pulls down the lsit of texture uuids. Showing the outout confirms that it is keeping the data in the correct format. However using 

list picList = [body];

does not allow the slideshow to function. I can take the output from both picList or body and paste it between the brackets in the above code with no changes and the sklide show functions.  As I said this is probably a simple answer I am ovelrooking, but I was under the impression that lsl would see [body] the same as the output that body outputs using a say command. Is there some trick to make this work?

Link to comment
Share on other sites

It depends on your database, I'm sure, but I would guess that body is a string variable with embedded comma delimiters.  If you try

list picList = llCSV2List(body);

it will probably work.  Otherwise, you can take the longer route and write

list picList = llParseString2List(body,[","],[]);

Link to comment
Share on other sites

Thank you for the quick response Rolig. I tried both of those and sadly neither worked , I was hopeful.

using mysql, I do have it seperated by commas , the output the database sends back is

"6ff6836a-e549-fe01-0888-eee8f385be69","093bfdf2-14c5-b6a9-aa2b-38faa8ee103d","bdf66db3-d8a2-9702-4249-9f3d52ee1370","92fc4635-59e5-dbda-7c2f-9f371a1051dc","47987c74-9b02-bee4-616a-6dd73d154eed","d7a0ce95-1557-f0c8-3c4c-c96cd54dadd5","9eb918c3-2e93-2967-8b5d-854655a74c68","b35b981d-31cf-4787-ac37-3ddb60fb0c4e","9d600e35-7cef-9db0-0849-54fcb5ce24ba","980b293c-2692-5795-0e1b-36b4b27addc8","48e569e2-2532-96f8-921c-887185e92afd","cf8e9e87-6fb5-cd91-7b73-e1515a7e8213","cc833c36-7ed5-a0a7-4a41-10541ba99084","48d7456c-5f6e-0228-6068-f009a5150b13"

now if I take that exact output and place it into

list picList = ["6ff6836a-e549-fe01-0888-eee8f385be69","093bfdf2-14c5-b6a9-aa2b-38faa8ee103d","bdf66db3-d8a2-9702-4249-9f3d52ee1370","92fc4635-59e5-dbda-7c2f-9f371a1051dc","47987c74-9b02-bee4-616a-6dd73d154eed","d7a0ce95-1557-f0c8-3c4c-c96cd54dadd5","9eb918c3-2e93-2967-8b5d-854655a74c68","b35b981d-31cf-4787-ac37-3ddb60fb0c4e","9d600e35-7cef-9db0-0849-54fcb5ce24ba","980b293c-2692-5795-0e1b-36b4b27addc8","48e569e2-2532-96f8-921c-887185e92afd","cf8e9e87-6fb5-cd91-7b73-e1515a7e8213","cc833c36-7ed5-a0a7-4a41-10541ba99084","48d7456c-5f6e-0228-6068-f009a5150b13"]

Then the code works and the textures display as they should.

Link to comment
Share on other sites

23 minutes ago, Shades Babad said:

the output the database sends back is

"6ff6836a-e549-fe01-0888-eee8f385be69","093bfdf2-14c5-b6a9-aa2b-38faa8ee103d","bdf66db3-d8a2-9702-4249-9f3d52ee1370","92fc4635-59e5-dbda-7c2f-9f371a1051dc","47987c74-9b02-bee4-616a-6dd73d154eed","d7a0ce95-1557-f0c8-3c4c-c96cd54dadd5","9eb918c3-2e93-2967-8b5d-854655a74c68","b35b981d-31cf-4787-ac37-3ddb60fb0c4e","9d600e35-7cef-9db0-0849-54fcb5ce24ba","980b293c-2692-5795-0e1b-36b4b27addc8","48e569e2-2532-96f8-921c-887185e92afd","cf8e9e87-6fb5-cd91-7b73-e1515a7e8213","cc833c36-7ed5-a0a7-4a41-10541ba99084","48d7456c-5f6e-0228-6068-f009a5150b13"

Oh!  So it has the quote marks in it?  Then use

list picList = llParseString2List(body,[",","\""],[]);

See if that works.

EDIT:  Let me space that out so it's clearer:   llParseString2List(body, [ ","  , "\"" ],[]);

 

Edited by Rolig Loon
  • Thanks 1
Link to comment
Share on other sites

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