To "freeze" a number passed to a list

the_math-hobbyist shared this question 3 years ago
Answered

Hi.

I want to make an applet with a record of the problems put to the user. I have made a nested list lstHistory to store these values (say, three values a, b, c stored in a lower-level list lstElement). The lstHistory is fed with a button.


Could I get the new row in lstHistory "frozen", i.e., independent of the a, b, c values? (now, when I change the a, b, or c values, the lstHistory is changed: my record doesn't work.)


I am trying to get the same goal with JavaScript, but to achieve it with only GeoGebra objects will be nice (or with only a few lines of JavaScript).


Thanks.

Comments (3)

photo
2

if you want store the value of a in independent form you can try b=copyfreeobject(a) in script, so b stores the value of a

when a changes b does not change until you run the script again

photo
1

Thanks, mathmagic. It works very well.

photo
photo
2

You can also use SetValue( <List>, <Number>, <Object> ) to extend a list (so you can add values one-at-a-time)


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

© 2023 International GeoGebra Institute