Hi everyone,
For some reason, when using predefined procedures blocks, the input arguments are not getting the value selected on the Canvas, but the "name" of the arguments instead.
The XML code I used for the predefined procedure block is:
<category name="Functions on Items">
<block editable="false" type="procedures_defnoreturn">
<field name="NAME">insertElementToItem</field>
<mutation>
<arg name="item" varid="currentItem"></arg>
<arg name="element" varid="newElement"></arg>
</mutation>
<comment pinned="false" h="80" w="160">Describe this function...</comment>
</block>
</category>
The code used to get both input arguments is:
var value_item = Blockly.JavaScript.valueToCode(block, 'item', Blockly.JavaScript.ORDER_ATOMIC);
var value_element = Blockly.JavaScript.valueToCode(block, 'element', Blockly.JavaScript.ORDER_ATOMIC);
So, what is happening is that in both, value_item and value_element, when I alert the received input it is "item" for value_item and "element" for value_element.
I simply don't know why and how to fix this. Could you please help me?
Thank you and I will be waiting for your response.
Best regards,