|
makena Apprentice
Joined: 11 Aug 2006 Posts: 100
|
Posted: 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 |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
makena Apprentice
Joined: 11 Aug 2006 Posts: 100
|
Posted: Thu Sep 21, 2006 7:52 pm |
omg *blush* thanks
|
|
|
|
|
|