t_convconst.mod 329 B

123456789
  1. MODULE TConvConst;
  2. // ISO type conversion in a CONST initialiser: a subrange applied to a
  3. // constant folds to that constant (representation-preserving).
  4. TYPE ind = [-100..100];
  5. CONST low = ind(-100); high = ind(100);
  6. VAR ExitCode : INTEGER;
  7. BEGIN
  8. ExitCode := low + 100 + (high - 100) + 42 (* 0 + 0 + 42 *)
  9. END TConvConst.