# Difference between revisions of "SetValue Command"

Jump to: navigation, search

##### SetValue

This article is about GeoGebra command.

##### Command Categories (All commands)

SetValue[ <Boolean>, <0|1> ]
Sets the state of a boolean / check box : 1 = true, 0 = false
Example: If b is a boolean, ` SetValue[b,1]` sets the boolean b as true.

SetValue[ <Object>, <Object> ]
LetA be the first and B the second object. If A is a free object or a Point restricted to Path or Region, its value is set to current value of B (i.e. A doesn't change value if B is changed afterwards).
Example: If f is a function, `SetValue[f, RandomElement[{cos(x), 3x+2, ln(x)}]]` defines, at random, f as being one of the functions proposed in the list.

SetValue[ <List>, <Number>, <Object> ]
Let n be the <Number>. The command SetValue sets the n-th element of a free list to the current value of the object. Number n can be at most 1 + length of L.

## SetValue in scripting

If you want to change value of an object in Scripting, always use SetValue rather than =. See Responsive Applets for more information.

• GeoGebra
• Help
• Partners
• Contact us
• Feedback & Questions
• This email address is being protected from spambots. You need JavaScript enabled to view it.
• +43 677 6137 2693
© 2021 International GeoGebra Institute