Hello Pidea,
the test whether a string is null or not is relevant for native C code only as explained in Be careful when exchanging string. Therefore the following code will report Chora compiler error: "Bad operands combination in expression with the operator '!='. The given operator was used with illegal operands of type 'string' and 'null'.":
if ( label != null ) // <-- will report 'error'
text.String = label;
The above implementation would be correct in native C code only. If you want to test in Chora whether a string is empty or not, simply compare the string with an empty string literal "". For example:
if ( label != "" )
text.String = label;
Starting with Embedded Wizard 10.00 the explicit comparison with an empty string can be omitted. To test whether a string is empty or not, just evaluate the string itself within the condition. For example:
if ( label )
text.String = label;
Also possible, but less efficient is the approach to query the length of the string by using its property length. If the string is empty, its length is 0. For example:
if ( label.length )
text.String = label;
Best regards
Paul Banach