Skip navigation
Currently Being Moderated

Help with code

Mar 2, 2013 1:00 PM

Can anyone help me with a code I want to sort out?

I want the code under to work as followed.

 

When the "ValuIn" is 1, I want "Red" to be set, and "2" for "green"

 

 

 

if(ValueIn)

    {

         

     NewBatteryStatus = "Red";

         

    }

    else

    {

    

     NewBatteryStatus = "Green";

    

    }

 
Replies
  • Currently Being Moderated
    Mar 2, 2013 1:18 PM   in reply to fsoender

    I cannot be sure I am clear on what you want, but if I think I get it my response is...

     

    if(ValueIn == 1) {

         NewBatteryStatus = "Red";

    } else  if(ValueIn == 2) {

         NewBatteryStatus = "Green";

    }

     

    Just realize that code will only execute once the way you have it and any change in the value of ValueIn will not automatically change the value of NewBatteryStatus

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 2, 2013 4:00 PM   in reply to fsoender

    You're welcome

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points