 |
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Fri May 28, 2010 7:57 pm
[3.18a Bug] #if not evaluating correctly in some cases. |
If you try the expression (%null==@var) it evaluates correctly, but if you try (@var==%null) it does not.
Local variables were not affected by this oddly enough.
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<class name="Test" copy="yes">
<alias name="TestIF" copy="yes">
<value>#var list {1|2|3}
#addkey db {a=1|b=2|c=3}
$list2={A|B|C}
#var string one
#if (%null(@string)) {#print {Test 1: string shows as null.}} {#print {Test 1: string shows as Not null.}}
#if (%null==@list) {#print {Test 2: string shows as null.}} {#print {Test 2: string shows as Not null.}}
#if (@list==%null) {#print {Test 3: string shows as null.}} {#print {Test 2: string shows as Not null.}}
//
#print {The string contains'@string'}
//
#if (%null(@list)) {#print {Test 1: list shows as null.}} {#print {Test 1: list shows as Not null.}}
#if (%null==@list) {#print {Test 2: list shows as null.}} {#print {Test 2: list shows as Not null.}}
#if (@list==%null) {#print {Test 3: list shows as null.}} {#print {Test 2: list shows as Not null.}}
//
#print {The list contains'@list'}
//
#if (%null(@DB)) {#print {Test 1: DB shows as null.}} {#print {Test 1: DB shows as Not null.}}
#if (%null==@DB) {#print {Test 2: DB shows as null.}} {#print {Test 2: DB shows as Not null.}}
#if (@DB==%null) {#print {Test 3: DB shows as null.}} {#print {Test 2: DB shows as Not null.}}
//
#print {The database contains'@DB'}
//
#if (%null($list2)) {#print {Test 1: list2 shows as null.}} {#print {Test 1: list2 shows as Not null.}}
#if (%null==$list2) {#print {Test 2: list2 shows as null.}} {#print {Test 2: list2 shows as Not null.}}
#if ($list2==%null) {#print {Test 3: list2 shows as null.}} {#print {Test 2: list2 shows as Not null.}}
//
#print {The list contains'$list2'}</value>
</alias>
</class>
</cmud>
|
In 3.17 wrote: |
Test 1: string shows as Not null.
Test 2: string shows as Not null.
Test 2: string shows as Not null.
The string contains'one'
Test 1: list shows as Not null.
Test 2: list shows as Not null.
Test 2: list shows as Not null.
The list contains'1|2|3'
Test 1: DB shows as Not null.
Test 2: DB shows as Not null.
Test 2: DB shows as Not null.
The database contains'a=1|b=2|c=3'
Test 1: list2 shows as Not null.
Test 2: list2 shows as Not null.
Test 2: list2 shows as Not null.
The list contains'A|B|C' |
In 3.18a wrote: |
Test 1: string shows as Not null.
Test 2: string shows as Not null.
Test 3: string shows as null.
The string contains'one'
Test 1: list shows as Not null.
Test 2: list shows as Not null.
Test 3: list shows as null.
The list contains'1|2|3'
Test 1: DB shows as Not null.
Test 2: DB shows as Not null.
Test 3: DB shows as null.
The database contains'c=3|b=2|a=1'
Test 1: list2 shows as Not null.
Test 2: list2 shows as Not null.
Test 2: list2 shows as Not null.
The list contains'A|B|C' |
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri May 28, 2010 10:40 pm |
OK, that's definitely a weird one. Not sure why the order would matter, but it's confirmed and easy to reproduce. Thanks.
|
|
|
 |
|
|