|
|
| Author |
Message |
stevech
Joined: 23 Feb 2006
Posts: 657
|
|
Posted: 20 October 2006, 3:29 AM Post subject: case in a case problem |
|
|
I get this warning, unexpected because the relational would seem to be equality rather than a difference...
905: Warning: Case expression value on line 903 takes precedence over this Case expression
for this code at line 903
| Code: | case "H"
call showHistoryEvents(TRUE)
case "h"
call showHistoryEvents(FALSE) |
the select variable is
| Code: | | select case (mid(s,1,1)) |
I recoded the switch to use asc() for the cases, eliminated the warning, but am curious.
Last edited by stevech on 20 October 2006, 4:09 AM; edited 2 times in total |
|
| Back to top |
|
 |
pjc30943
Joined: 02 Dec 2005
Posts: 220
|
|
Posted: 20 October 2006, 3:55 AM Post subject: Re: case in a case problem |
|
|
| Which is line 903? |
|
| Back to top |
|
 |
stevech
Joined: 23 Feb 2006
Posts: 657
|
|
Posted: 20 October 2006, 4:07 AM Post subject: |
|
|
| the first, where "H" appears |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 20 October 2006, 4:17 AM Post subject: |
|
|
| I suspect that the compiler is using a case-insensitive comparison to check for case duplication when it should be using case-sensitive. Your clever workaround has me puzzling, however. |
|
| Back to top |
|
 |
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR
|
|
Posted: 20 October 2006, 4:35 AM Post subject: |
|
|
| Regarding your workaround, I see now why it works. That changes it from a String comparison to a Byte comparison. |
|
| Back to top |
|
 |
|