“SetValue 指令”的版本间的差异

来自GeoGebra Manual
跳转至: 导航搜索
 
(未显示同一用户的1个中间版本)
第1行: 第1行:
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|scripting}}
 
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|scripting}}
;SetValue( <Boolean>, <0|1> )
+
;SetValue( < 真假值>, <0|1> )
:Sets the state of a boolean / check box : 1 = true, 0 = false
+
: 設定一個真假值或勾選框的狀態:1 = true 、0 = false
:{{example|1=If  ''b'' is a boolean, <code> SetValue(b,1)</code> sets the boolean ''b'' as ''true''.}}
+
:{{example|1= ''b'' 是一個真假值,<code>SetValue(b,1)</code> 會把真假值 ''b'' 設為 ''true'' }}
  
;SetValue( <Object>, <Object> )
+
;SetValue( < 物件 A>, < 物件 B> )
:Let''A'' be the first and ''B'' the second object. 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).
+
: ''A'' 是一個[[ 自變、應變、輔助物件| 自變物件]] 或是一個依附於[[ 幾何物件#路徑| 路徑或區域]] [[ 點與向量| ]] ,此指令會將 ''A'' 的值設定為 ''B'' 目前的值(也就是說執行完指令之後,改變 ''B'' 並不會影響到 ''A'' )。
:{{example|1=If  ''f'' is a function, <code>SetValue(f, RandomElement({cos(x), 3x+2, ln(x)}))</code> defines, at random, f as being one of the functions proposed in the list.}}
+
:{{example|1= ''f'' 為一函數,<code>SetValue(f, RandomElement({cos(x), 3x+2, ln(x)}))</code> 會以隨機的方式將 f 定義為串列中的其中一個函數。}}
  
  
;SetValue( &lt;List>, <Number>, <Object> )
+
;SetValue( &lt; 串列 L>, < 數值 n>, < 物件> )
: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.
+
: 此指令將一個自變 <串列 L> 中的第 ''n'' 個元素設定為 < 物件> 目前的值。''n'' 最多可以設為 ( L 的長度 + 1 ),會直接在 L 的最後新增一個元素。
  
  
;SetValue( <[[Action_Objects#Drop-down lists|drop-down list]]>, <Number n > ) : Set  ''n'' as [[SelectedIndex_Command| the index of the selected element]] in the drop-down list.
+
;SetValue( <[[ 動作物件# 下拉式選單| 下拉式選單]]>, < 數值 n > ) 
 +
: 設定下拉式選單中[[SelectedIndex_指令|目前選取元素的索引]]為 ''n''

2021年7月27日 (二) 10:38的最新版本

Accessories dictionary.png
本頁為官方文件,一般使用者無法修改,若有任何誤謬,請與官方聯絡。如欲編輯,請至本頁的開放版


SetValue( <真假值>, <0|1> )
設定一個真假值或勾選框的狀態:1 = true、0 = false。
範例:b 是一個真假值,SetValue(b,1) 會把真假值 b 設為 true
SetValue( <物件 A>, <物件 B> )
A 是一個自變物件或是一個依附於路徑或區域,此指令會將 A 的值設定為 B 目前的值(也就是說執行完指令之後,改變 B 並不會影響到 A)。
範例:f 為一函數,SetValue(f, RandomElement({cos(x), 3x+2, ln(x)})) 會以隨機的方式將 f 定義為串列中的其中一個函數。


SetValue( <串列 L>, <數值 n>, <物件> )
此指令將一個自變 <串列 L> 中的第 n 個元素設定為 <物件> 目前的值。n 最多可以設為 ( L 的長度 + 1 ),會直接在 L 的最後新增一個元素。


SetValue( <下拉式選單>, <數值 n > )
設定下拉式選單中目前選取元素的索引n

Comments

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

若想要在程式腳本中更改某物件的值,強烈建議使用 SetValue 而不是等號(=)。詳情請參閱效能良好的圖檔

© 2024 International GeoGebra Institute