تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
blockly > الأسماء > getDistinctName
طريقةNames.getDistinctName()
تحويل اسم كيان Blockly إلى اسم قانوني لكيان قابل للتصدير. تأكَّد من أنّ هذا الاسم جديد ولا يتداخل مع أي اسم سبق تحديده. تحقَّق أيضًا من قائمة الكلمات المحجوزة للغة الحالية وتأكَّد من عدم تعارض الاسم.
Signature:
getDistinctName(name: string, type: NameType | string): string;
المعلمات
المعلمة |
النوع |
الوصف |
الاسم |
سلسلة |
اسم الكيان Blockly (بدون قيود). |
كتابة |
نوع الاسم | سلسلة |
نوع الكيان في Blockly ('VARIABLE' أو 'PROCEDURE' أو ' developer_VARIABLE'، إلخ...). |
المرتجعات:
سلسلة
اسم كيان قانوني باللغة التي يتم تصديرها.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-09-10 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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"]],["تاريخ التعديل الأخير: 2024-09-10 (حسب التوقيت العالمي المتفَّق عليه)"],[[["`Names.getDistinctName()` converts a Blockly entity name into a legal, unique exportable name."],["The method ensures the name is distinct, avoiding conflicts with existing names and reserved words."],["It requires the original name and the entity type as input and returns a safe, exportable name."]]],["The `getDistinctName` method converts a Blockly entity name into a legal, exportable name. It ensures the new name is unique, avoiding overlaps with previously defined names and reserved words of the target language. The method takes the original `name` (a string) and its `type` (either `NameType` or a string, e.g., 'VARIABLE') as input and returns a valid, unique string name suitable for export.\n"]]