[Pas2js] A pascal version of the C ternary operator ( ? : )

Michael Van Canneyt michael at freepascal.org
Sat Dec 22 14:54:05 CET 2018



On Sat, 22 Dec 2018, warleyalex via Pas2js wrote:

> if then else alternative feature ( ? : )
>
>
> Amazing to see new fetures introduced to pas2js. I must say that I do really
> like this syntax.
>
> ------- // pascal version // ------
> var
>  msg: String;
> begin
>  msg := "There are " + IntToStr(n) + " user" + if (n>1) then "s" else "";
> end;

Normally, this will be introced in FPC, so we'll then also introduce it in
pas2js.

Michael.


More information about the Pas2js mailing list