סקר מחקר: נשמח לשמוע על החוויה שלך עם Blockly
לפתיחת הסקר
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
blockly > VariableMap > getVariable
השיטה VariableMap.getVariable()
מאתרים את המשתנה לפי השם והסוג שצוינו ומחזירים אותו. הפונקציה מחזירה ערך null אם הוא לא נמצא.
Signature:
getVariable(name: string, opt_type?: string): IVariableModel<IVariableState> | null;
פרמטרים
פרמטר |
סוג |
תיאור |
שם |
מחרוזת |
השם שרוצים לבדוק. |
opt_type |
מחרוזת |
(אופציונלי) הסוג של המשתנה. אם לא מציינים ערך, ברירת המחדל היא מחרוזת ריקה, שהיא סוג ספציפי. |
החזרים:
IVariableModel<IVariableState> | null
המשתנה עם השם שצוין, או null אם הוא לא נמצא.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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 VariableMap by its name and optionally by its type."],["If a matching variable is found, the method returns a `VariableModel` object representing that variable; otherwise, it returns `null`."],["The `name` parameter is mandatory and specifies the name of the variable to search for."],["The `opt_type` parameter is optional and specifies the type of the variable; if not provided, it defaults to the empty string, which represents a specific type in Blockly."]]],[]]