Condition to test only enabled options?

Forums ProRealTime English forum ProBuilder support Condition to test only enabled options?

Viewing 5 posts - 1 through 5 (of 5 total)
  • #202488

    Ten options can be enabled or disabled by the user.

    If they are enabled their value will not be zero and needs to be tested against another variable.

    If their value is not zero and less than the tested value, then they would be included in the indicator otherwise they wouldn’t.

    I just want to set the backgroundcolor to something else if they are enabled and pass the test, but it needs to be only for the pool of options enabled

    My question is how to achieve this test? I’ve drawn a blank.

    Is it a complicated nested if statement? Any pointers greatly appreciated.

    Thanks

    Rob

    #202502

    I’m thinking do the test on each variable and if it passes then add it to an array, once all ten have been tested check to see if the array is empty or not and set backgroundcolor accordingly.

    Would this work as no time to code it now.

    Thanks

    Rob

    #202521

    The array solution is good. You can test the minimal value of the array is ARRAYMIN.

    You can also do a simple addition of all values and test the result is above or below a minimal value?

    #202543

    Thanks Nicolas, I’ve had a go but I’m clearly not creating the array properly.

    I want the indicator to check the condition for each bar and change the background colour accordingly.

    I’d be grateful if you could tell me what I’m doing wrong. Thanks.

    Rob

     

    #202566

    Eventually got there! Thanks though.

Viewing 5 posts - 1 through 5 (of 5 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login