SetValue 指令

来自GeoGebra Manual
Nuhero讨论 | 贡献2021年7月27日 (二) 09:52的版本
跳转至: 导航搜索
Accessories dictionary.png

SetValue( <Boolean>, <0|1> )
Sets the state of a boolean / check box : 1 = true, 0 = false
范例: 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).
范例: 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( <drop-down list>, <Number n > )
Set n as the index of the selected element in the drop-down list.


在程式脚本中使用 SetValue 指令[编辑]

若想要在程式脚本中更改某物件的值,强烈建议使用 SetValue 而不是等号(=)。详情请参阅效能良好的图档

© 2022 International GeoGebra Institute