1. Can't use global/public constant in switch/case ?
- Posted by AndySerpa Feb 16, 2011
- 1304 views
If using a global or public constant(s) declared in another file in a switch statement, it won't resolve. Is this known?
constant C1 = 1, C2 = 2, C3 = 3 switch x do case C1 then ... case C2 then ... case C3 then ... end switch
The above works, but if C1, etc are declared in an included file (as global or public), it doesn't work, although those constants seem available otherwise.
2. Re: Can't use global/public constant in switch/case ?
- Posted by raseunew Feb 16, 2011
- 1248 views
Euphoria Interpreter v4.0.0
Linux, Using System Memory
Revision Date: 2010-12-22, Id: 115714454200
seems to only affect global switch statements
ie:
if the switch statement appears inside
a procedure or function, then the
error goes away
have'nt read the eu4 manual.
this may be by design
a
3. Re: Can't use global/public constant in switch/case ?
- Posted by mattlewis (admin) Feb 16, 2011
- 1266 views
If using a global or public constant(s) declared in another file in a switch statement, it won't resolve. Is this known?
No, that should work. I've created ticket:617 for this issue.
As a work around, you can use qualified references (i.e., use a namespace qualifier).
Matt