[Opensim-users] strReplace not functioning in OpenSim?
Ai Austin
ai.ai.austin at gmail.com
Wed Jul 27 16:17:18 UTC 2011
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 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=
More information about the Opensim-users
mailing list