• Resolved hheyhey568

    (@hheyhey568)


    Hello team,
    If it possible to define multiple variables with if statement?
    Like
    If(filedname==1 ) variable1=X variable2=Y variable3=Z ;
    if it possible or any easy way?

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @hheyhey568

    Who are the variable1, variable2, and variable3 for you?

    If they are variables you want to use in the rest of the equation’s code, the structure could be similar to the following one:

    Note that it is a hypothetical equation. The values and operations were selected only to illustrate the implementation of the equations with the function structure and the use of return instruction to return the equation’s result.

    (function(){
    var variable1, variable2, variable3;
    if(fieldname1 == 1)
    {
       variable1 = 12;
       variable2 = 34;
       variable3 = 56;
    }
    else
    {
       variable1 = 21;
       variable2 = 43;
       variable3 = 65;
    }  
    
    /* Here the code that uses the variables and very important, return the equation's result */
    
    return variable1*variable2+variable3;
    })()

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘If to set multiple variables’ is closed to new replies.