canRender example
Suppose you’re printing a balance sheet and you want to highlight all the negative numbers by making them red. The default colorNormal property of the Text component is black. Use the following canRender event handler to set the colorNormal property appropriately just before the component is rendered:
function someFigure_canRender()
this.colorNormal := iif( this.text() < 0, "red", "black" )
return true
Because the text property of the Text component is an expression codeblock, to get the value that is going to be displayed, call the component’s text property. Don’t forget to RETURN true; otherwise the component is never displayed.