Delphi E2013 Type of expression must be INTEGER
Only when the constant expression that specifies the amount of characters in a string type is not of type integer does this error message appear.
Pascal
x
7
1
program Produce;
2
type
3
color = (red,green,blue);
4
var
5
S3 : string[Succ(High(color))];
6
begin
7
end.
The example attempts to describe the number of elements in a string as a function of the maximum element of type colour; however, the element count is of type colour, which is prohibited.
Pascal
xxxxxxxxxx
1
7
1
program Solve;
2
type
3
color = (red,green,blue);
4
var
5
S3 : string[ord(High(color))+1];
6
begin
7
end.
Leave Your Comment