If command problem

mihail.smirnov shared this question 3 years ago
Answered

I have variable "c" and varibale "a". In "a" I have geogebra script.


If[a == 1000, SetValue[c, c=c+100], SetValue[c, c=c-100]]

It doesn't work.

Comments (1)

photo
1

You can't use adssignments inside a command. The correct syntax is


If[a == 1000, SetValue[c, c+100], SetValue[c, c-100]]

or

SetValue[c, c + If[a == 1000, 100, -100]]

© 2019 International GeoGebra Institute