[fpc-pascal] New feature: IfThen() intrinsic

Michael Van Canneyt michael at freepascal.org
Tue Feb 2 11:04:15 CET 2016



On Tue, 2 Feb 2016, Graeme Geldenhuys wrote:

> On 2016-02-02 09:44, Michael Van Canneyt wrote:
>>
>> N:=iif(Assigned(A),A.Name,'Nil');
>>
>> You'll get a crash using regular functions because All arguments are
>> evaluated prior to calling iif().
>
>
> Okay, fair enough. Thanks for the example.
>
>
> Then again, it is a relatively small corner case. I've not hit that
> issue in 15+ years using tiUtils. Maybe I was just lucky. ;-)  Either
> way, I understand better now.

Well, you must have been lucky indeed.
I hit it regularly in logging statements.

Michael.



More information about the fpc-pascal mailing list