Constant Expressions  (Advanced)

Top  Previous  Next

An expression that consists entirely of constants can be used in place of any constant such as in a "define" declaration (or constant array). The compiler calculates the required constant. For example:


        def     SEC_PER_HR = 60.0 * 60.0;

        def     SEC_PER_DAY = SEC_PER_HR * 24.0;

        def     HI = ^I<<8 ! ^H;


All expression operators can be used. Unfortunately, function calls, such as Rem(17/5), cannot be used. This means that integers and reals cannot be mixed in an expression since the intrinsics Fix and Float cannot be used.