blockly > VariableMap > getVariableById
Metoda variableMap.getVariableById()
Znajdź zmienną na podstawie podanego identyfikatora i zwróć ją. Jeśli nie znaleziono, zwracaj wartość null.
Podpis:
getVariableById(id: string): VariableModel | null;
Parametry
Parametr |
Typ |
Opis |
id |
ciąg znaków |
Identyfikator do sprawdzenia. |
Zwroty:
VariableModel | wartość null
Zmienna o podanym identyfikatorze.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-09-10 UTC.
[null,null,["Ostatnia aktualizacja: 2024-09-10 UTC."],[[["The `getVariableById` method searches for a variable within the VariableMap using its unique ID."],["If a variable with the given ID is found, the method returns the corresponding VariableModel object; otherwise, it returns null."],["This method accepts a single string parameter representing the variable's ID to be located."]]],[]]