Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Articnal
Apprentice


Joined: 19 Jan 2002
Posts: 107

PostPosted: Sat Oct 25, 2003 8:59 am   

This should work!!
 
Hi,i put next on the command line on zmud:

#if (%replace("170,288",",","")<@nextlvl) {#echo Happens} ---> Happens
#echo @nextlvl ---> 45511
#echo (%replace("170,288",",","")<@nextlvl) ---> (170288<45511)

Shouldnt the #if do nothing instead of doing the #echo?? [V]

Thanks for any help [^]
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Oct 25, 2003 12:44 pm   
 
The %replace leaves hidden quotes in its return. Since an arguement to the less than operator is a string it does an alphabetical comparison and that is why it is true. Use the %number function to force it work the way you want.

#if (%number(%replace("170,288",",",""))<@nextlvl) {#echo Happens}
Reply with quote
Articnal
Apprentice


Joined: 19 Jan 2002
Posts: 107

PostPosted: Sat Oct 25, 2003 5:07 pm   
 
Thank you Smile
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net