Home AMX User Forum NetLinx Studio

Potentially very simple DEVCHAN question

Sort of a beginner here, thrown into the thick of things. I have what I think is probably a simple question- I want to reference a DEVCHAN in an IF statement. Specifically, something along the lines of IF ([DEVCHAN == ON]) however that returns a syntax error. How do I write that properly? Can I use ON in that manner, do I not need the == and just a comma instead?

Thanks in advance!

Comments

  • try

    if([DEVCHAN]){}

  • That's it- I don't need to add a "modifier" of any kind? ON/==/ or assign a value for ON?

    Your suggestion compiles fine I am just not sure how it would work as I haven't specified what I want from the DEVCHAN?

    Thanks!

  • In NetLinx everything that is not '0' is considered true, '0' is false:

    If (variable)
    {
        //runs when variable is not zero
    }
    
  • @richardherman said:
    In NetLinx everything that is not '0' is considered true, '0' is false:

    If (variable)
    {
        //runs when variable is not zero
    }
    

    0 is false and in this case false is off.... and true would be on

  • Thanks all! That got me what I needed. Appreciate the fast responses!

Sign In or Register to comment.