Jump to content
You are about to reply to a thread that has been inactive for 4258 days.

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

Recommended Posts

Posted

Any recommendations for which character to use as a separator for storing, transporting and retrieving lists with  llDumpList2String etc .


I will be storing user input so an out of way character is needed, but it does not have to be foolproof; i.e.. the script  crashing if someone  purposely feeds that character is acceptable

A control character perhaps? Any best practices on this subject?

Posted

Pipe symbol is not safe at all for my purposes. I was thinking something more exotic like ascii char 31 which is nicely named in ascii tables "unit separator", and prints as a small triangle symbol.

string SEPARATOR = llBase64ToString(llDeleteSubString(llIntegerToBase64(31),0,3));

Any reason I should NOT use it?

Posted

In most of my projects I use separator  ",,," as I'm yet to see an SL name that includes three commas in a row. This of course does increase memory usage by 2 bytes per name which may be relevant if strings or lists are long so a script operates within a thin red line between stack and heap :)

In those projects where a separator indeed may turn out crucial, I use weird unicode characters from non-latin sets, those of course must be translated back and forth but it is pretty trivial.

  • 4 weeks later...
Posted

In the end I used character 31

string SAFE_SEP = ""; //chr(31)

and after a while I ended up using it everywhere, even in trivial situations

In SL it prints as very distinct black triangle , which is good for visual inspection

The only drawback I can see is that, as above, it will not show at all in notepad, and show  as a space in wordpad and in lsl editor. Notepad++ shows it as a "US" (Unit Separator) on black background so that's ok. In all cases, copy and pasting it to-and-fro preserves it (as one would reasonably expect) , so you can copy it from above even though you can't see it.

Thank you all for your replies.

You are about to reply to a thread that has been inactive for 4258 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
×
×
  • Create New...