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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
makena
Apprentice


Joined: 11 Aug 2006
Posts: 100

PostPosted: Thu Sep 21, 2006 7:15 am   

[1.06] %null() and %len() with zero length
 
tested this two ways... both gave errors when the test string had no length

Code:
#alias {test} {#if {%len(%1)=0} {#say {zero}} {#say {more then zero}}}
#alias {test2} {#if {%null(%1)=1} {#say {zero}} {#say {more then zero}}}


I was unable to submit a bug report for some reason.
I have the saved bugreport.txt if you would like it
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Sep 21, 2006 7:12 pm   
 
Well, you have a number of syntax errors here. First, the name of the alias cannot be enlosed in {}. Also, the expression for the #IF statement must be enclosed in parenthesis (). The correct syntax is:
Code:
#alias test {#if (%len(%1)=0) {#say {zero}} {#say {more then zero}}}
#alias test2 {#if (%null(%1)) {#say {zero}} {#say {more then zero}}}

and both of these examples work fine.
Reply with quote
makena
Apprentice


Joined: 11 Aug 2006
Posts: 100

PostPosted: Thu Sep 21, 2006 7:52 pm   
 
omg *blush* thanks
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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