Problem with the script in the button

josipk shared this problem 2 years ago
Not a Problem

Hello,

my friend has a problem with a script in the button. He put a script like this:

If(a<5, u=u+1,u=0)

t=t+1

For first several clicks on the button it works, after that, it doesn't work... Can someone help with advice?

GeoGebra file is in the attachment.

Files: aaa.ggb

Comments (1)

photo
1

It's advised not to formulate it like that but to use following syntax:

SetValue(t, t+1)SetValue(u,If(a<5,u+1,0))

With this script there's no problem

© 2023 International GeoGebra Institute