Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
case in a case problem

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
stevech



Joined: 23 Feb 2006
Posts: 657

Posted: 20 October 2006, 3:29 AM    Post subject: case in a case problem Reply with quote

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))
Shocked

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 Reply with quote

Which is line 903?
Back to top
stevech



Joined: 23 Feb 2006
Posts: 657

Posted: 20 October 2006, 4:07 AM    Post subject: Reply with quote

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: Reply with quote

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: Reply with quote

Regarding your workaround, I see now why it works. That changes it from a String comparison to a Byte comparison.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group