Difference between revisions of "SetValue Command"
From GeoGebra Manual
Line 2: | Line 2: | ||
{{command|scripting}} | {{command|scripting}} | ||
;SetValue[ <Object A>, <Object B> ] | ;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). | + | :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[ <Boolean b>, <0|1> ] | ;SetValue[ <Boolean b>, <0|1> ] | ||
:Same as above; instead of SetValue[b,true] you can use SetValue[b,1], 0 can replace false. | :Same as above; instead of SetValue[b,true] you can use SetValue[b,1], 0 can replace false. | ||
;SetValue[ <List L>, <Number n>, <Object B> ] | ;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. | :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. |
Revision as of 00:09, 4 May 2011
- 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).
- SetValue[ <Boolean b>, <0|1> ]
- Same as above; instead of SetValue[b,true] you can use SetValue[b,1], 0 can replace false.
- 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.