getArrayFromChoice( )

選択肢のラベルまたはコードを複数選択の質問(ドロップダウン、ラジオ・ボタン、チェック・ボックス)から配列に変換します。

構文

getArrayFromChoice(variable, [option])

パラメータ

変数

ルール・エディタの選択変数。

オプション
オプション。選択コントロール値のどの要素を返すかを定義します。
  • "label": 選択した選択制御ラベル(オプションが指定されていない場合はデフォルト)を返します。
  • "code": 質問の選択肢がコードリスト形式の場合、選択した選択制御コードを返します。

戻り値

  • 何も選択されていない場合は空の配列。
  • 選択した選択ラベルの配列。

例3-89「はい」および「いいえ」というラベルが選択されたドロップダウン(選択肢)コントロールd2があるとします。

// Return the first selected label from choice item dd2:
returngetArrayFromChoice(dd2)[0];
// returns "Yes"  

// Return the second selected label from choice item dd2:
return getArrayFromChoice(dd2)[1];
// Returns "No"

// Return the first selected code from choice item dd2:
return getArrayFromChoice(dd2, "code")[0];
// returns C1