Problems with the SetValue Command and functions

Andreas Clement Holmgaard shared this question 3 years ago
Answered

I'm trying to add together a bunch of functions but I want to be able to change their values to that of another function.


Therefor I decided to use the SetValue function which from my understanding sets the value of object "a" to the value of obejct "b" and not the object itself.


When I set the value of a function A to the value of function B, function A changes its value and I can then change function B, but when I update function A it changes to the current value of function B.


If nothing of that made any sense, check the attached the file.


What am I doing wrong and how do i fix it.


Thanks in advance for anyone willing to look into this.

Best Answer
photo

Try:

  1. SetValue[g, CopyFreeObject[f]]

Comments (5)

photo
1

Try:

  1. SetValue[g, CopyFreeObject[f]]

photo
1

That's it!

Thanks alot.

Have a nice day.

photo
photo
1

Hi,


The same problem :

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


clic on "modifier le sol"...

then, set new modifications...

then clic "ajouter la courbe rouge"...

then see and try...

...

photo
2

maybe this is useful for you.

Working with lists: you write much more less and you are more flexible

photo
1

Hi rami,


This could be useful to record students responses in auto generated exercises, I think.

Thanks for the idea and coding here.

© 2020 International GeoGebra Institute