You are not logged in.

1

Wednesday, October 19th 2011, 5:23pm

IFNOT is not working

Hi there,

I'm using KRPano for quite a while now and don't understand what i do wrong at this point:

Source code

1
<action name="test">ifnot(get(xml.scene) == fitness, trace(get(xml.scene)); 	);</action>


Elsewhere i have a plugin with the function:

Source code

1
onclick="test();"


The output is:

Source code

1
INFO: fitness


This should be impossible because if the outcome of get(xml.scene) would be 'fitness' it should not give me that trace, right? What i am doing wrong?

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

2

Wednesday, October 19th 2011, 5:48pm

try 'fitness'
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

3

Wednesday, October 19th 2011, 5:54pm

Thanks. Tried it, but the trace still gives 'fitness' back.

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

4

Wednesday, October 19th 2011, 6:09pm

Hi krTim,

Using get() inside the condition is not needed:
The var1 or var2 can be a variables or values. When var1 or var2 is a variable then the content of the variable will be used for comparison. Only when using a 'strict' comparison operator (=== or !==) then var1 and var2 must be variables (or null).
Your code should be:

Source code

1
<action name="test">ifnot( xml.scene == fitness , trace(xml.scene);   );</action>


SAlut.

5

Wednesday, October 19th 2011, 6:36pm

Thanks a lot Michel, it works like a charm now.