Code
<action name="testme">
if(%2,
trace(%2 ' exists');
);
if(%2 === 'null',
trace(%2 ,' ===null');
);
if(%2 == null,
trace(%2 ,' ==null');
);
ifnot(%2 === null,
trace(%2 ,' not===null');
);
ifnot(%2 == null,
trace(%2 ,' not==null');
);
ifnot(%2,
trace(%2 ,' not');
);
</action>
Alles anzeigen
krpano.call("testme(c3,false);");
undefined
krpano.call("testme(c3,fals);");
undefined
krpano.call("testme(c3,5);");
INFO: false not===null
INFO: false not==null
INFO: false not
INFO: fals ===null
INFO: fals not==null
INFO: fals not
INFO: 5 ' exists'
INFO: 5 ===null
INFO: 5 not==null
Problems are:
Everything === null except for boolean values
if(var,... doesn't work for non numeric values
errata
z === null
"z=" not ===null