Consider the following program:
program fstr(output); type sat = packed array [1..16] of 'K'..'O'; var sa : sat; begin sa := 'OK'; writeln('Sizeof(sa) = ', Sizeof(sa)); writeln(sa) end .
ATM it "works". However, it seems that this program is illegal. Namely ISO says:
: Each value of a string-type shall be structured as a one-to-one : mapping from an index-domain to a set of components possessing : the char-type
And later it again speaks about `the char-type'. So it seems that subranges of char type are _not_ allowed as component types of strings.
Form implementation point of view subranges can be packed more tightly then char type, so such restriction make some sense.
Now, the question is what shall we do? And do you agree with my reading of the standard? Shall we disallow the program above. Or maybe accept it as an extension, but report an error in standard mode.