# GetAlternativeCount

GetAlternativeCount() 用於找出指定欄位中替代值 (淺灰色) 的數量。

語法：

GetAlternativeCount (field\_name)

**傳回資料類型：**整數

引數：

* field\_name： 包含待測量資料範圍的欄位。

## 範例

下列範例使用載入到列表框的 First name 欄位，以及下列語法：

`GetAlternativeCount  ([First name])`

* 假定已在 First name 中選取 John，則指令碼傳回 4，因為 First name 中有 4 個唯一且已排除 (灰色) 的值。
* 假定已選取 John 和 Peter，則指令碼傳回 3，因為 First name 中有 3 個唯一且已排除 (灰色) 的值。
* 假定在 First name 中沒有選取任何值，則指令碼傳回 0，因為沒有選項。

範例中使用的資料：

`Names:` `LOAD * inline [` `"First name"|"Last name"|Initials|"Has cellphone"` `John|Anderson|JA|Yes` `Sue|Brown|SB|Yes` `Mark|Carr|MC |No` `Peter|Devonshire|PD|No` `Jane|Elliot|JE|Yes` `Peter|Franc|PF|Yes ] (delimiter is '|');`