|
Zyphrus Newbie
Joined: 27 Mar 2004 Posts: 7
|
Posted: Sat Mar 27, 2004 9:37 pm
strange behaviour of %replace inside %eval |
I've got a trigger that is supposed to do some calculations with a number after stripping all commas from it. But it only works if I don't put %replace inside %eval. Let's say %1 is 250,000. %replace( "%1", ~,, "") works, but %replace( %1, ~,, "") doesn't (it returns 250 instead). When inside %eval, it returns 250 again :
%eval(%replace( "%1", ~,, ""))
How do I solve this problem? Do I have to use a dummy variable to save the result from %replace? Does zMUD have variables which only exist within a trigger/function/... script? |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sat Mar 27, 2004 10:25 pm |
UNTESTED but should work remove the ~ and quote the comma with ""
%eval(%replace( "%1", ",", ""))
or if that one doesn't
%eval(%replace( "%1", ",", %null)) |
|
|
|
Zyphrus Newbie
Joined: 27 Mar 2004 Posts: 7
|
Posted: Sat Mar 27, 2004 11:01 pm |
Thanks for the fast reply! I just tried your solution and it works perfectly
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|