Tip handling void values in function parameters and return values
In the Sage X3 language, there is no dedicated keyword for null numeric, dates, or string values. The only exception is the Null pointer.
Technically, an empty string, a null date, or a zero numeric value can be declared with the following syntaxes:
# Assigning "null" valuesMY_DATE=[0/0/0]MY_DECIMAL=0MY_STRING=""# Another solutionRaz MY_DATE, MY_DECIMAL, MY_STRING
Using these "null constants" makes the code easier to read:
# Assigning "null" valuesMY_DATE=AVOID.ADATEMY_DECIMAL=AVOID.ADECMY_STRING=AVOID.ACHAR
AVOID
value to a property is allowed while keeping the property value unchanged. This is especially useful when a method or a function requires a parameter (sent as a variable) that you do not want to manage. In that case, AVOID
will prevent you from declaring a variable that will not be used. The same concept applies for other return values that have to be ignored. For example:AVOID.AINT=Fmet this.METHOD : # I do not care about the return valueCall MYROUTINE(PARAM1, PARAM2, AVOID.ACLOB) : # The last parameter is a clob that can be empty
When dealing with null values, don't avoid 'AVOID'!