[fpc-pascal] List of chars for case

R0b0t1 r030t1 at gmail.com
Mon Jul 2 02:19:29 CEST 2018


On Sun, Jul 1, 2018 at 5:51 PM, Ryan Joseph <ryan at thealchemistguild.com> wrote:
> Is there a way to make a constant for a list of chars which I can use in a case statement? I’ve got a bunch of code duplication happening I’d like to clean up.
>
> const
>   TChars = ('[', ']', '(', ')', '{', '}', '=', ‘:’);
>
>
> case c of
>   TChars:
>     ...
>

I suspect you may need to use sets and the "in" operator.



More information about the fpc-pascal mailing list