Below i have the blocks generating the following js code:

I want to be able to put the function in the if statement, like so:
```
if (checkdistance() == 0) {
}
```
But i get this error:

Im not sure how to solve this, my code for the block 'ultra' as follows:
block:
Blockly.Blocks['ultra'] = {
init: function() {
this.appendDummyInput()
.appendField("read distance");
this.setInputsInline(true);
this.setOutput(true, null);
this.setColour(sensor_color);
this.setTooltip("");
this.setHelpUrl("");
}
};
generator:
Blockly.JavaScript.ultra = function () {
return "checkdistance()"
}
Any Advice would be appreciated.