[fpc-pascal] Case in Record

章宏九 secludedsage at gmail.com
Tue Oct 6 17:37:58 CEST 2009


Thank you. I saw all the examples you gave, but I still cannot master
how to use a variant record without a specified tag.

For example:
type
  TShapeList = (Rectangle, Triangle, Circle, Ellipse, Other);
  TFigure = record
    case TShapeList of
      Rectangle: (Height, Width: Real);
      Triangle: (Side1, Side2, Angle: Real);
      Circle: (Radius: Real);
      Ellipse, Other: ();
  end;
var
  Figure1: TFigure;

How can I specified the TShapelist value in a Figure1?


2009/10/6 Henry Vermaak <henry.vermaak at gmail.com>:
> 2009/10/6 Henry Vermaak <henry.vermaak at gmail.com>:
>>
>> I can't really comment on the scary details, since I'm rubbish at
>> object oriented programming :)
>
> And objects aren't deprecated, since the compiler uses them (afaik).
>
> Henry
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>



More information about the fpc-pascal mailing list