I'm trying to use a variable as a case condition, however it seems you cannot, as the error I get is "constant expected"

I'm wondering if there is a way to work around this limitation?

my variable is a string.

Recommended Answers

All 2 Replies

>I'm trying to use a variable as a case condition

No! case label must be a constant value.

Ok thanks.

if's it is then.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.