This compatibility requirement seems to imply that the control variable need not be an integer type. Does this mean that
Var letter: char;
for letter := 'A' to 'Z' do
is legitimate, or that the definers of the language expected that might eventually be allowed? Or does it merely mean that the magnitudes must match the range, so that
Var num: smallint;
for num := 20000 to 40000 do
is illegal?
In a message dated 4/26/2013 4:28:41 P.M. Eastern Daylight Time, jonas.maebe@elis.ugent.be writes:
: The initial-value and the final-value of a sequence-iteration : of an iteration-clause of a for-statement shall be of a type : compatible with the type of control-variable of the for-statement. : The initial-value and the final-value shall be : assignment-compatible with the type possesed by the : control-variable if the statement of the for-statement : is executed.
On 27 Apr 2013, at 00:03, Contestcen@aol.com wrote:
This compatibility requirement seems to imply that the control variable need not be an integer type. Does this mean that
Var letter: char; for letter := 'A' to 'Z' do
is legitimate, or that the definers of the language expected that might eventually be allowed?
It certainly is valid. The same goes for boolean and enumeration types.
Jonas