assurance-tunnel
assurance-tunnel
assurance-tunnel
assurance-tunnel

JavaScript Actor Output Assign



  • Hello Again, ran into another question: I need to individually address the different outputs in the JavaScript Actor. Here is the code: 

    function main()

    {

    var x = arguments[0];

    if (x >= 37 && x <= 39 )

    {return (1)} //output to first output

    if (x >= 41 && x <= 43 )

    {return (1)} //output to 2nd output

    }

    Any suggestions? Thanks a lot !


  • Tech Staff

    @salimelo

    Does this help: https://community.troikatronix... ?

    Best Michel



  • @Salimelo if you just want to send one trigger to a dedicated output, this is not possible since the js output is an array by itself like the js input.

    but if it is just the sorting you care for it could be something like.

    function main()
    {     var x = arguments[0]; var o = [0,0]; if (x >= 37 && x <= 39 ){
        o[0]=1;
        } if (x >= 41 && x <= 43 ){
        o[1]=1;
        }
    print(o + " \n") // shows the value in the monitor
    return o
    }

    if you need a trigger you can use a comparator actor
    best m_theater

    js_trigger_mec.izz



  • @salimelo

    I think you have good reason t use Java but you can also get the same with trigger by usingInside Range actors

    best

    Jean-François


  • Tech Staff

    Just a quick add. I have tested with both using null and undefined in an attempt to have an output not trigger.
    In both cases Isadora is converting these into false (zero) values.