Bug? Comparing variables set through set() are never equal

  • When I define an action in the .xml like:

    Code
    set('test', 'krpano');
    set('test2', 'krpano');
    
    
    if(get('test') == get('test2'), trace('true');, trace('not true'););


    The output is shown as 'not true'. Is this defined behavior, and when it is, how do I use get() and set() to do value comparison?

  • Hi Jan Jongboom,

    The get() action inside the IF condition is not needed... the variables are self resolved if exist or are converted to a string...
    See here and here ...
    So your code would be:

    Code
    set(test, 'krpano');
    		set(test2, 'krpano');
    
    
    		if(test == test2, trace('true');, trace('not true'););

    Hope this help....

    SAlut.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!