Show object under two condition

bgmadhu shared this question 4 months ago
Answered

I want to show a text when two conditions are satisfied. Problem is first condition is value of a slider (n=3) and the second condition is a boolean value (e=true).

Comments (7)

photo
1

In the Conditions to show object box of your text (right click on it, then select the Advanced tab) type

n==3 && e


Double == sign for testing the value

&& means AND

photo
1

See also this wiki page about Conditional Visibility https://wiki.geogebra.org/e...

and this one about Boolean values and the related syntax in GeoGebra

https://wiki.geogebra.org/e...

photo
1

Is there a way to have more than 2 conditions to show an object?


2 conditions works fine for say a slider and a check box, I currently use:


if(a > 0,b = true)


but I'd like to have a 3rd and possibly 4th condition,


I've tried things like if(a > 0,b = true, c = false) but it only accepts the first 2 conditions and ignores the third.


Any help would be greatly appreciated.

photo
1

Don't use an If command, just type in the needed conditions in the Condition to show object textbox.

See my examples above and the attached example, where the triangle is shown iif a>0 AND boolean b is true AND boolean c is false.

Right click on the triangle to open its Properties window. Select the Advanced tab and have a look at the Condition to show object, that appears like


a > 0 ∧ b ∧ (¬c)

I've typed in that box


a>0 && b && !c
See references to boolean operators linked above.

b means b=true

!c means c=false

You can enter b==true AND c== false which is the longer input, but both are fine.

photo
1

try

photo
1

I could have sworn I'd tried that and it was giving me errors, anyway works perfectly, thanks!

photo
1

Hi,

To have many conditions, you can use list :

https://www.geogebra.org/ma...


...

photo
© 2018 International GeoGebra Institute