[fpc-devel] case is

Hairy Pixels genericptr at gmail.com
Wed Mar 23 16:00:05 CET 2022

Lol I just implemented this and made a merge request but I haven’t heard back from anyone yet so it’s just sitting there….

I basically just copied the structure used for “case of string” in that it makes if a big if-else statement.


> On Mar 23, 2022, at 7:44 PM, Mattias Gaertner via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
> Basically for Pascal it is a case block using the "is" operator.
> Pseudo code:
> procedure Fly(o: TObject);
> begin
> case o is
> TButton: TButton(o).foo;
> TControl: TControl(o).bar;
> TComponent: TComponent(o).meh;
> nil: Msg;
> else Run;
> end;
> end;

	Ryan Joseph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20220323/ee3f3086/attachment.htm>

More information about the fpc-devel mailing list