// For a single line text field.conststr=generator.quote_(block.getFieldValue('STR'));// For a multiline text field.conststr=generator.multiline_quote_(block.getFieldValue('STR'));
[[["易于理解","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"]],["最后更新时间 (UTC):2025-04-14。"],[[["Fields in Blockly define user-editable values (strings, numbers, colors, etc.) for code generation."],["Access field values using `getFieldValue`, transform them into usable strings (e.g., quoting strings, scrubbing variable names), and concatenate them into the code."],["Use `quote_` or `multiline_quote_` to properly format string values for code generation."],["Use `getVariableName` to ensure variable names are valid and avoid conflicts in the generated code."],["Refer to specific block type documentation for details on returning the generated code."]]],["Code generation with fields involves retrieving user-inputted values, such as strings or numbers, from fields. `getFieldValue` accesses these values, which vary by field type. Strings need quoting via `quote_` or `multiline_quote_`, while variables require scrubbing with `getVariableName` to ensure they are ASCII and don't clash with reserved words. Finally, the processed field value is inserted into the code string. The completed code string is returned depending on the specific type of block.\n"]]