> On Jul 2, 2018, at 10:55 PM, leledumbo via fpc-pascal
> wrote:
>
> Only through macro ATM
Yeah I cheated and used a macro. ...and that’s why we should allow for macros
as a fail safe in times of distress...
Regards,
Ryan Joseph
___
> So it can’t be done?
Only through macro ATM, I believe. Note that case statement body does NOT
expect a set (it expects values, list of values and/or range of values),
despite the very similar look (missing enclosing angle brackets only), hence
the inability to do what you want.
--
Sent
> On Jul 2, 2018, at 2:07 AM, Mattias Gaertner
> wrote:
>
> That would be useful.
So it can’t be done?
Regards,
Ryan Joseph
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
On Sun, 1 Jul 2018 16:51:08 -0600
Ryan Joseph 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 = ('[', ']', '(', ')', '{', '}', '=', ‘:’);
>
>
>
Ryan Joseph 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:
...
Regards,
On Sun, Jul 1, 2018 at 5:51 PM, Ryan Joseph 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
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:
...
Regards,
Ryan Joseph