Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
blockly > VariableMap > getVariableById
Méthode VariableMap.getVariableById()
Recherchez la variable à l'aide de l'ID donné et renvoyez-la. Renvoie la valeur "null" si l'élément n'est pas trouvé.
Signature :
getVariableById(id: string): IVariableModel<IVariableState> | null;
Paramètres
Paramètre |
Type |
Description |
id |
chaîne |
ID à vérifier. |
Renvoie :
IVariableModel<IVariableState> | null
Variable avec l'ID donné.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/05/16 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/05/16 (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."]]],[]]