View on GitHub

NullCoaliescing

Null Coaliescing method using 4D

COALESCE

Allow to return the first non NULL element.

Inspired from COALESCE SQL function.

Usage

For each without checking if NULL

C_VARIANT($value;$Obj)
$Obj:=New object(...
For each ($value;COALESCE ($Obj.collection1;$Obj.collection3;New collection))
	// do something
End for each

💡 For only one possible NULL parameter you can use NVL

Test

see test_COALESCE


Elvis