Yes,<br> The old LSL memory optimization "tricks" of nulling a list or a string before concatination do NOT transfer well.<br>D<br><br><div class="gmail_quote">On Thu, Jul 28, 2011 at 3:00 AM, <span dir="ltr"><<a href="mailto:opensim-users-request@lists.berlios.de">opensim-users-request@lists.berlios.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Send Opensim-users mailing list submissions to<br>
<a href="mailto:opensim-users@lists.berlios.de">opensim-users@lists.berlios.de</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://lists.berlios.de/mailman/listinfo/opensim-users" target="_blank">https://lists.berlios.de/mailman/listinfo/opensim-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:opensim-users-request@lists.berlios.de">opensim-users-request@lists.berlios.de</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:opensim-users-owner@lists.berlios.de">opensim-users-owner@lists.berlios.de</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Opensim-users digest..."<br>
<br>Today's Topics:<br>
<br>
1. strReplace not functioning in OpenSim? (Ai Austin)<br>
2. Re: strReplace not functioning in OpenSim? (Neil Canham)<br>
<br><br>---------- Forwarded message ----------<br>From: Ai Austin <<a href="mailto:ai.ai.austin@gmail.com">ai.ai.austin@gmail.com</a>><br>To: <a href="mailto:opensim-users@lists.berlios.de">opensim-users@lists.berlios.de</a><br>
Date: Wed, 27 Jul 2011 17:17:18 +0100<br>Subject: [Opensim-users] strReplace not functioning in OpenSim?<br>I seem to be having a problem with some utility functions in LSL in a script I am trying to bringing over from a Second Life display screen... This strReplace function from <a href="http://wiki.secondlife.com/wiki/Combined_Library" target="_blank">http://wiki.secondlife.com/<u></u>wiki/Combined_Library</a> which we have used seems to be the problem:<br>
<br>
I wonder if someone knows the problem, as the two routines used are indicated as implemented in OpenSim.<br>
<br>
For these tests I was using OpenSim 0.7.1.1 and 0.7.2 dev master and Imprudence and SL 2.8.0 viewers, so I think its not a specifuc version or viewer issue.<br>
<br>
------------------------------<u></u>-----------<br>
<br>
string strReplace(string str, string search, string replace) {<br>
return llDumpList2String(<u></u>llParseStringKeepNulls((str = "") + str, [search], []), replace);<br>
}<br>
<br>
default {<br>
touch_start(integer num){<br>
llSay(0,"avatar="+<u></u>llDetectedName(0));<br>
llSay(0,"avatar_mod="+<u></u>strReplace(llDetectedName(0)," ","_"));<br>
}<br>
}<br>
<br>
------------------------------<u></u>------------------<br>
The first line works, the second just lists when touched by an avatar with a name like "Ai Austin" it is meant to be able to replace the spaces with underscores and produce "Ai_Austin" but it actually seems to return the null string in OpenSim 0.7.2 dev master r/16364 anyway.<br>
<br>
avatar=Ai Austin<br>
avatar_mod=<br>
<br>
<br>
<br>
<br><br>---------- Forwarded message ----------<br>From: Neil Canham <<a href="mailto:neil@knowsense.co.uk">neil@knowsense.co.uk</a>><br>To: <a href="mailto:opensim-users@lists.berlios.de">opensim-users@lists.berlios.de</a><br>
Date: Wed, 27 Jul 2011 18:00:09 +0100<br>Subject: Re: [Opensim-users] strReplace not functioning in OpenSim?<br>The issue seems to be the (str = "") in strReplace - not sure what that does, maybe some kind of SL-specific memory optimisation? Removing that made it work for me.<div>
<br></div><div>Neil Canham</div><div>CTO vComm Solutions GmbH<br>
<br><div class="gmail_quote">On Wed, Jul 27, 2011 at 5:17 PM, Ai Austin <span dir="ltr"><<a href="mailto:ai.ai.austin@gmail.com" target="_blank">ai.ai.austin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I seem to be having a problem with some utility functions in LSL in a script I am trying to bringing over from a Second Life display screen... This strReplace function from <a href="http://wiki.secondlife.com/wiki/Combined_Library" target="_blank">http://wiki.secondlife.com/<u></u>wiki/Combined_Library</a> which we have used seems to be the problem:<br>
<br>
I wonder if someone knows the problem, as the two routines used are indicated as implemented in OpenSim.<br>
<br>
For these tests I was using OpenSim 0.7.1.1 and 0.7.2 dev master and Imprudence and SL 2.8.0 viewers, so I think its not a specifuc version or viewer issue.<br>
<br>
------------------------------<u></u>-----------<br>
<br>
string strReplace(string str, string search, string replace) {<br>
return llDumpList2String(<u></u>llParseStringKeepNulls((str = "") + str, [search], []), replace);<br>
}<br>
<br>
default {<br>
touch_start(integer num){<br>
llSay(0,"avatar="+<u></u>llDetectedName(0));<br>
llSay(0,"avatar_mod="+<u></u>strReplace(llDetectedName(0)," ","_"));<br>
}<br>
}<br>
<br>
------------------------------<u></u>------------------<br>
The first line works, the second just lists when touched by an avatar with a name like "Ai Austin" it is meant to be able to replace the spaces with underscores and produce "Ai_Austin" but it actually seems to return the null string in OpenSim 0.7.2 dev master r/16364 anyway.<br>
<br>
avatar=Ai Austin<br>
avatar_mod=<br>
<br>
<br>
______________________________<u></u>_________________<br>
Opensim-users mailing list<br>
<a href="mailto:Opensim-users@lists.berlios.de" target="_blank">Opensim-users@lists.berlios.de</a><br>
<a href="https://lists.berlios.de/mailman/listinfo/opensim-users" target="_blank">https://lists.berlios.de/<u></u>mailman/listinfo/opensim-users</a><br>
</blockquote></div><br></div>
<br>_______________________________________________<br>
Opensim-users mailing list<br>
<a href="mailto:Opensim-users@lists.berlios.de">Opensim-users@lists.berlios.de</a><br>
<a href="https://lists.berlios.de/mailman/listinfo/opensim-users" target="_blank">https://lists.berlios.de/mailman/listinfo/opensim-users</a><br>
<br></blockquote></div><br>