0

What I have

In TurboPascal I have defined an enumerated type TState and a set TStateS of this type.

type
  TState = (CS_Type1, CS_Type2, CS_Type3, CS_Type4 );
  TStateS = set of TState;

Also I have a function doing some calculation that should return a set

function Calc: TStateS;
begin
  { do calculate here and return }
  Calc := CS_Type1 + CS_Type2;
end;

My problem

The TurboPascal compiler complains with Error 34 "Invalid result type of function". The turbo pascal manual states that ordinal types are ok but does not mention sets.

My Question

Is there any other method of returning a set as a function result?

Georg W.
  • 1,292
  • 10
  • 27

0 Answers0