Consider the following program:

program Project1;

type
  TMyEnum = (
    a = 1,
    b = 3,
    c = 5
  );
  TMySet = set of TMyEnum;
var
  Item: TMyEnum;

begin
  for Item in TMySet do
    Writeln('Value = ', Integer(Item));
end.


I would expect the output of the program to contain the values 1, 3 and 5 only. But the actual output is:
Value = 1
Value = 2
Value = 3
Value = 4
Value = 5

Is this a bug or a know limitation of the "for ... In ... do" loop?

I am using fpc 2.6.4

Regards,
Torsten.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to