blockly > الأسماء > (أداة الإنشاء)
Names.(constructor)
إنشاء مثيل جديد لفئة Names
Signature:
constructor(reservedWordsList: string, opt_variablePrefix?: string);
المعلمات
المعلمة |
النوع |
الوصف |
reservedWordsList |
سلسلة |
سلسلة من الكلمات المفصولة بفواصل غير قانونية للاستخدام كأسماء في اللغة (على سبيل المثال، "new,if,this,..."). |
opt_variablePrefix |
سلسلة |
(اختياري) تحتاج بعض اللغات إلى "$" أو مساحة اسم قبل جميع أسماء المتغيرات (ولكن ليس أسماء الإجراءات). |
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-10-14 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-10-14 (حسب التوقيت العالمي المتفَّق عليه)"],[[["The `Names` class manages the generation of unique names for variables and procedures within Blockly."],["A new `Names` instance is created using the constructor, requiring a list of reserved words in the target language."],["An optional prefix for variable names can be specified during construction for languages that require them."]]],["The `Names` class constructor creates a new instance. It takes two parameters: `reservedWordsList`, a comma-separated string of illegal words, and `opt_variablePrefix`, an optional string for languages needing a prefix for variable names. The constructor initializes the class with these reserved words and optional prefix to manage and validate names.\n"]]