แบบสำรวจการวิจัย: บอกให้เราทราบเกี่ยวกับประสบการณ์การใช้งาน Blockly
เริ่มแบบสำรวจ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
blockly > IVariableMap > createVariable
เมธอด IVariableMap.createVariable()
สร้างตัวแปรใหม่ที่มีชื่อที่ระบุ หากไม่ได้ระบุรหัส แผนที่ตัวแปรควรสร้างรหัสขึ้นมา แสดงผลตัวแปรใหม่
ลายเซ็น:
createVariable(name: string, id?: string, type?: string | null): T;
พารามิเตอร์
พารามิเตอร์ |
ประเภท |
คำอธิบาย |
ชื่อ |
สตริง |
|
id |
สตริง |
(ไม่บังคับ) |
ประเภท |
string | null |
(ไม่บังคับ) |
การคืนสินค้า:
T
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[],[],null,["[blockly](./blockly.md) \\\u003e [IVariableMap](./blockly.ivariablemap_interface.md) \\\u003e [createVariable](./blockly.ivariablemap_interface.createvariable_1_methodsignature.md)\n\nIVariableMap.createVariable() method\n------------------------------------\n\nCreates a new variable with the given name. If ID is not specified, the variable map should create one. Returns the new variable.\n\n**Signature:** \n\n createVariable(name: string, id?: string, type?: string | null): T;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|-----------|----------------|--------------|\n| name | string | |\n| id | string | *(Optional)* |\n| type | string \\| null | *(Optional)* |\n\n**Returns:**\n\nT"]]