Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
blockly > CodeGenerator > statementToCode
CodeGenerator.statementToCode() yöntemi
Adlandırılmış ifade girişine eklenmiş blokları temsil eden bir kod dizesi oluşturun. Kodu girin. Bu yöntem, çoğunlukla jeneratörlerde kullanılır. Değerlendirmek için kod oluşturmaya çalışırken workspaceToCode veya blockToCode'u kullanmayı deneyin.
İmza:
statementToCode(block: Block, name: string): string;
Parametreler
Parametre |
Tür |
Açıklama |
engelle |
Engelleme |
Girişi içeren blok. |
ad |
dize |
Girişin adı. |
İadeler:
dize
Oluşturulan kod veya blok bağlı değilse "'".
İstisnalar
Belirtilen giriş mevcut değilse ReferenceError.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-25 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-25 UTC."],[[["The `statementToCode` method generates code for blocks connected to a specific statement input on a block."],["It's primarily used within Blockly generators for code generation purposes."],["If you need to generate code for evaluation, consider using `workspaceToCode` or `blockToCode` instead."],["The method takes the block and the input name as parameters and returns the generated code as a string."],["If no blocks are connected to the input, it returns an empty string."]]],[]]