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. https://gitlab.com/freepascal.org/fpc/source/-/merge_requests/147 > On Mar 23, 2022, at 7:44 PM, Mattias Gaertner via fpc-devel > <fpc-devel@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; Regards, Ryan Joseph
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel