option #31

IF statement format

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS

System option #31 determines which IF statement syntax the Synergy compiler recognizes.

If you set option #31, the compiler uses the alternate form of the IF statement during compilation, instead of the ANS DIBOL form. The alternate IF form is equivalent to using the alternate IF compiler option (for example, -a or -qaltif on UNIX).

Using the alternate IF syntax, an ELSE clause matches the previous IF clause. ANS DIBOL IF syntax, on the other hand, matches the ELSE clause with the previous THEN clause.

We’ll use the following pseudocode as an example:

if (expr1)
  then if (expr2)
  else stmt2

With option #31 set, stmt2 is executed only if expr1 is true and expr2 is false. If option #31 is not set, ANS DIBOL IF compilation is used, and stmt2 is executed whenever expr1 is false.