แบบสำรวจการวิจัย: บอกให้เราทราบเกี่ยวกับประสบการณ์การใช้งาน Blockly
เริ่มแบบสำรวจ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
blockly > VariableMap > getVariable
เมธอด VariableMap.getVariable()
ค้นหาตัวแปรตามชื่อและประเภทที่ระบุ แล้วแสดงผล แสดงผล Null หากไม่พบ
ลายเซ็น:
getVariable(name: string, opt_type?: string): IVariableModel<IVariableState> | null;
พารามิเตอร์
พารามิเตอร์ |
ประเภท |
คำอธิบาย |
ชื่อ |
สตริง |
ชื่อที่จะตรวจสอบ |
opt_type |
สตริง |
(ไม่บังคับ) ประเภทของตัวแปร หากไม่ได้ระบุไว้ ระบบจะใช้สตริงว่างเป็นค่าเริ่มต้น ซึ่งเป็นประเภทที่เฉพาะเจาะจง |
การคืนสินค้า:
IVariableModel<IVariableState> | null
ตัวแปรที่มีชื่อที่ระบุ หรือค่าว่างหากไม่พบ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 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."]]],[]]