Root > Reference > All Functions > IfElse

Function IfElse

Previous pageReturn to chapter overviewNext page   

A replacement for ternary if operator.

 

Unit

ELowLevel

 

Syntax

 

Code (Delphi)

function IfElse(

const AOK: Boolean;

const AStr1: String;

const AStr2: String = ''

): String;

 

Parameters

AOK [in]

Condition.

 

AStr1 [in]

Result for True.

 

AStr2 [in, optional]

Result for False.

 

Return value

Returns AStr1 if AOK is True.

 

Returns AStr2 if AOK is False.

 

Remarks

 

Warning

Both arguments (AStr1 and AStr2) are calculated. This is different from the real ternary if operator like AOK ? AStr1 : AStr2 in C++.

 




Send feedback... Build date: 2023-09-11
Last edited: 2023-09-11
PRIVACY STATEMENT
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.


Permanent link to this article: https://www.eurekalog.com/help/eurekalog/topic_function_elowlevel_ifelse.php