[fpc-devel] Proposal: IIF - IfThen Cond True False

Hans-Peter Diettrich DrDiettrich1 at aol.com
Wed Jan 12 11:14:36 CET 2011


kingbizugo at gmail.com schrieb:
>   I come here humbly to  ask for a new  implementation, the IIF ?:, the 
> IIF is a shortcut that make the coding a little faster, it works by 
> returning a true or a false part of a condition, a more detailed 
> information can be found there: http://en.wikipedia.org/wiki/%3F:
> 
> *PHP and C++ implementation:* Value *=* condition *?* value if true *:* 
> value if false;
> *Pascal implementation:* Value := IfThen(Condition, TruePart, FalsePart);

The standard Pascal implementation of the C ternary expression is a
   const Name: array[boolean] of <type> = (FalseFart, TruePart);
and
   Value := Name[Condition];

DoDi




More information about the fpc-devel mailing list