Skip to main content

Home > blockly > CodeGenerator > valueToCode

CodeGenerator.valueToCode() method

Generate code representing the specified value input.

Signature:

valueToCode(block: Block, name: string, outerOrder: number): string;

Parameters

ParameterTypeDescription
blockBlockThe block containing the input.
namestringThe name of the input.
outerOrdernumberThe maximum binding strength (minimum order value) of any operators adjacent to "block".

Returns:

string

Generated code or '' if no blocks are connected.

Exceptions

ReferenceError if the specified input does not exist.