調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
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
指定された名前の変数。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-05-16 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-05-16 UTC。"],[[["The `getVariable` method searches for a variable within the workspace using its name and optional type."],["It returns the `VariableModel` of the matching variable or `null` if no such variable exists."],["When providing the optional type, omitting it or using an empty string is considered a specific type."]]],[]]