Trouble setting the value of a slider via button script

mweissa2 shared this question 5 months ago
Answered

I am just trying to create a button to set the value of a slider (c) based on the value of another variable (b). I have tried using the following command: SetValue[c, 10*b - 5] but when I click the button I get an error. Is something wrong with my syntax? It seems like this should be pretty straightforward.

Comments (4)

photo
1

Please post your file

photo
1

try with attached

photo
1

Here is the file. Note that I am not trying to control a variable with a slider; rather, I trying to set the current value of the slider to match another variable. I appreciate any help you can offer.

photo
1

Your command is correct, and it works

You only get an error if you write it in javascript instead of Script GeoGebra...

(and better -5 for min of c...)

photo
© 2020 International GeoGebra Institute