blockly > Workspace > getVariable

Workspace.getVariable() メソッド

v12: Blockly.Workspace.getVariableMap().getVariable を使用。

指定された名前で変数を見つけて返します。見つからない場合は null を返します。

署名:

getVariable(name: string, opt_type?: string): IVariableModel<IVariableState> | null;

パラメータ

パラメータ 説明
name 文字列 確認する名前。
opt_type 文字列 (省略可)変数の型。指定しない場合、デフォルトは空の文字列(特定のタイプ)になります。

戻り値:

IVariableModel<IVariableState> | null

指定された名前の変数。