Difference between revisions of "SetValue Command"

From GeoGebra Manual
Jump to: navigation, search
m (Text replace - "<div class="box info"> 48px|left This page is part of the official manual for print and pdf. For structural reasons normal users can't edit this page. If you found any errors on this page please contact )
Line 1: Line 1:
<noinclude>{{Manual Page|version=4.0}}</noinclude>
+
<noinclude>{{Manual Page|version=4.2}}</noinclude>
 
{{command|scripting}}
 
{{command|scripting}}
 
;SetValue[ <Object A>, <Object B> ]:If A is a [[Free, Dependent and Auxiliary Objects|free object]] or a [[Points and Vectors|Point]] restricted to [[Geometric Objects#Paths|Path or Region]], its value is set to current value of ''B'' (i.e. ''A'' doesn't change value if ''B'' is changed afterwards).
 
;SetValue[ <Object A>, <Object B> ]:If A is a [[Free, Dependent and Auxiliary Objects|free object]] or a [[Points and Vectors|Point]] restricted to [[Geometric Objects#Paths|Path or Region]], its value is set to current value of ''B'' (i.e. ''A'' doesn't change value if ''B'' is changed afterwards).

Revision as of 21:24, 9 March 2013



SetValue[ <Object A>, <Object B> ]
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[ <Boolean b>, <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[ <List L>, <Number n>, <Object B> ]
Sets n-th element of the free list L to the current value of B. Number n can be at most 1 + length of L.

Comments

SetValue in scripting[edit]

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

© 2024 International GeoGebra Institute