llCSV2List
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
09-14-2004 17:20
I'm getting confused about the syntax of llCSV2List.
I want to start with a string such as:
string mystring "As, Bs, Js, Dc, 10b";
Then convert this to a list such as with...
list mylist = llCSV2List(mystring);
Everything is declared but this is still an error?
Can someone show me an example of the correct way? And by the way, the WIKI did not answer my question.
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Bran Brodie
Registered User
Join date: 5 Jun 2004
Posts: 134
|
Re: llCSV2List
09-14-2004 17:50
From: someone Originally posted by Samhain Broom string mystring "As, Bs, Js, Dc, 10b";
Everything is declared but this is still an error?
string mystring = "As, Bs, Js, Dc, 10b"; The error message you get is something like: (4, 17) : ERROR : Syntax error Which tells you the line number, the character position and the type of error. In this case character position 17 is just after "mystring". Looking one can see that an "=" is missing. Read and try to figure out the error messages.  BTW, error line numbering seems to start at 0, kind of funny.
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
09-14-2004 18:08
ah ok.. I posted that wrong... here is the actual code I just now tested.
string mystring = "2a, 2b, 3c";
list mylist = llCSV2List(mystring);
The error msg says that the error is at the end of the "llCSV2List"
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Catherine Omega
Geometry Ninja
Join date: 10 Jan 2003
Posts: 2,053
|
09-14-2004 18:17
What error is it giving? Your syntax looks fine to me.
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
09-14-2004 19:16
http://forums.secondlife.com/images/icons/icon7.gifI've decided to try and work this one out without any further help. Thanks to everyone for helping so far.
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Adam Zaius
Deus
Join date: 9 Jan 2004
Posts: 1,483
|
09-15-2004 21:21
I've seen bugs in CVS2List relating to spaces. IE, Sl delimits by ', ' rather than just ',' - I find it's better to use:
llParseString2List(string,[","],[" "]);
-Adam
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
09-16-2004 08:49
Do you recommend not putting the spaces in the original CSV string if possible? IE:
string mystring = "this,is,the,string";
versus
string mystring = "this, is, my, string";
I can easily understand why the "spaceless" string would work better. That would make sense. I better go look at some documentation on the llCSV2List function again! Thanks for the heads up!
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Adam Zaius
Deus
Join date: 9 Jan 2004
Posts: 1,483
|
09-16-2004 08:54
Well, that's the bug. The first string you posted, last time I checked, will actually parse entirely as one list item. Only the second one will work with llCVS2List, whereas the function I posted will accept both forms.  -Adam
|
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
|
09-16-2004 11:29
Thanks, I will make sure I use that method. By the way, do you know if one method uses more or less memory? (not important, I'm just curoius... I guess I could try it and do an llSay of the memory left...)
Thanks, that will definately help with this project I am working on!
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
|
Adam Zaius
Deus
Join date: 9 Jan 2004
Posts: 1,483
|
09-16-2004 11:31
From: someone Originally posted by Samhain Broom Thanks, I will make sure I use that method. By the way, do you know if one method uses more or less memory? (not important, I'm just curoius... I guess I could try it and do an llSay of the memory left...)
Thanks, that will definately help with this project I am working on! Both will be identical in memory use and runtime.  -Adam
|