blockly > Workspace > getVariableById

Metoda Workspace.getVariableById()

v12: użyj Blockly.Workspace.getVariableMap().getVariableById.

Znajdź zmienną o podanym identyfikatorze i zwróć ją. Zwraca wartość null, jeśli nie znaleziono elementu.

Podpis:

getVariableById(id: string): IVariableModel<IVariableState> | null;

Parametry

Parametr Typ Opis
id ciąg znaków Identyfikator, który chcesz sprawdzić.

Zwroty:

IVariableModel<IVariableState> | null

Zmienna o podanym identyfikatorze.