Show: Object Pascal C++
Display Preferences

X1012 Constant expression violates subrange bounds (Object Pascal)

From Appmethod Topics
Jump to: navigation, search

Go Up to Error and Warning Messages (Object Pascal) Index

This error message occurs when the compiler can determine that a constant is outside the legal range. This can occur for instance if you assign a constant to a variable of subrange type.


program Produce;
var
  Digit: 1..9;
begin
  Digit := 0;  (*Get message: Constant expression violates subrange bounds*)
end.
	program Solve;
var
  Digit: 0..9;
begin
  Digit := 0;
end.
Personal tools
In other languages