I think all of us know the how works COALESCE SQL function.

I think all of us know the how works COALESCE SQL function. True? In a simple version, evaluates two arguments and if the first is NULL, returns the second.

I need this behaviour in Delphi.

Anyone know a standard function like this.
--------------------------
The problem becomes because I have a function that receives two parameters of type char and I need to send to it as the argument the first character of a TField and this TField can be null.

ReorganizeCoordinatesControls(
FEditComponent.LAYOUT.AsString[1],
FEditComponent.ORIENTATION.AsString[1]);

when is null, taking the first character causes an AVE. Apart, a variable of type char, can't receive an empty string.

-----------------------------

Of course, I know how to create the function. The curiosity is about if a standard function like this exists in the Delphi libraries.

Of course, I've searched on google, in forums, in stackoverflow and so on.

Anyone knows?
https://docs.microsoft.com/es-es/sql/t-sql/language-elements/coalesce-transact-sql?view=sql-server-2017

Comments