封鎖 >工作區 >getVariable

Workspace.getVariable() 方法

依據指定名稱找出變數並傳回。如果找不到,則傳回空值。

Signature:

getVariable(name: string, opt_type?: string): VariableModel | null;

參數

參數 類型 說明
名稱 字串 要檢查的名稱。
opt_type 字串 (選填) 變數類型。如果沒有提供此屬性,將預設為空字串,也就是特定的類型。

傳回:

VariableModel |空值

具有指定名稱的變數。