[Opensim-users] strReplace not functioning in OpenSim?

Neil Canham neil at knowsense.co.uk
Wed Jul 27 17:00:09 UTC 2011


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.

Neil Canham
CTO vComm Solutions GmbH

On Wed, Jul 27, 2011 at 5:17 PM, Ai Austin <ai.ai.austin at gmail.com> wrote:

> 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 http://wiki.secondlife.com/**
> wiki/Combined_Library <http://wiki.secondlife.com/wiki/Combined_Library>which we have used seems to be the problem:
>
> I wonder if someone knows the problem, as the two routines used are
> indicated as implemented in OpenSim.
>
> 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.
>
> ------------------------------**-----------
>
> string strReplace(string str, string search, string replace) {
>    return llDumpList2String(**llParseStringKeepNulls((str = "") + str,
> [search], []), replace);
> }
>
> default {
>    touch_start(integer num){
>       llSay(0,"avatar="+**llDetectedName(0));
>       llSay(0,"avatar_mod="+**strReplace(llDetectedName(0)," ","_"));
>    }
> }
>
> ------------------------------**------------------
> 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.
>
> avatar=Ai Austin
> avatar_mod=
>
>
> ______________________________**_________________
> Opensim-users mailing list
> Opensim-users at lists.berlios.de
> https://lists.berlios.de/**mailman/listinfo/opensim-users<https://lists.berlios.de/mailman/listinfo/opensim-users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-users/attachments/20110727/b49772a4/attachment.html>


More information about the Opensim-users mailing list