• I just recognised that sometimes (calc) we have to use ; mandatory

    like in this case, where that would work :

    Code
    set(myOtherVar, 10);
    if(%1 !== null, calc(myVar, %1 + myOtherVar); );
    debug('myVar value', myVar);

    and that would not :

    Code
    set(myOtherVar, 10);
    if(%1 !== null, calc(myVar, %1 + myOtherVar));
    debug('myVar value', myVar);

    With set and other actions you can just skip these "extra" semicolon, am I right ?

  • Hi,

    that's different reason / special case here - calc(...) (without the ';') has a special meaning when used as parameter - please see here:
    https://krpano.com/docu/actions/#calc

    In this case (without ';'):

    Code
    if(%1 !== null, calc(myVar, %1 + myOtherVar));

    it would be that situation - using calc() to resolve a parameter (the parameter of the if() action):

    Code
    action( calc(expression), ... )

    and 'myVar, %1 + myOtherVar' would be an invalid expression - mainly because of the ',' character.

    But in this case (with the ';'):

    Code
    if(%1 !== null, calc(myVar, %1 + myOtherVar););

    it would be that situation - that means a normal action call:

    Code
    calc(variable, expression)

    and therefore this case is working.

    That means it works basically as intended but I agree that can be confusing ;-).

    Best regards,
    Klaus

Participate now!

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