String var = <checked value> != null ? <checked value> : <alternative value>
ll_row_count = IfNull(uf_get_row_count(), 0)
li_min_allowed_age = IfNull(uf_get_min_allowed_age(), 18)
ls_full_name = ls_first_name + " " + IfNull(ls_mid_name + " ", "") + ls_last_name // ls_mid_name is optional
ls_err = "Invalid as_mode " + IfNull("'" + as_mode + "'", "NULL") + "." // prevent NULLifying of ls_err
ls_err = "Invalid ai_mode '" + IfNull(String(ai_mode), "NULL") + "'." // both the arguments must be of a same datatype!
lb_value_changed = (IfNull(ls_new_value, '') <> IfNull(ls_old_value, ''))
lcb_clicked_button = IfNull(acb_clicked_button, cb_cancel)
global function any IfNull (any aa_checked_value, any aa_alternative_value);
if IsNull(aa_checked_value) then
return aa_checked_value
else
return aa_alternative_value
end if
end function
ls_err = "Argument ai_mode contains illegal value " + IfNull(ai_mode, "NULL") + "." // runtime error - concatenating string with int!
benconsult wrote:It's no more dangerous than using dot notation
benconsult wrote:you can always make a function that's using an Any argument more robust by checking the classname to avoid runtime errors