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
Possible compiler bug: select case mid()

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



Joined: 23 Feb 2006
Posts: 656

Posted: 12 March 2006, 21:00 PM    Post subject: Possible compiler bug: select case mid() Reply with quote

I suspect this code demonstrates a compiler bug
Code:

option base 1

sub main()
   dim sMid as string, s1 as string

   do
      s1 = console.readline()
      debug.print "Readline returned:";s1
      
      sMid = mid(s1, 1, 2)      
      'select case sMid           ' this works correctly
      select case mid(s1, 1, 2) ' this does not work
         case "AB"
            debug.print "case AB"
         case "XX"
            debug.print "case XX"
      case else
         debug.print "case else:";mid(s1, 1, 2)
      end select
   loop
end sub
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2493
Location: Portland, OR

Posted: 13 March 2006, 3:38 AM    Post subject: Reply with quote

By inspection, I see that the generated code is incorrect. It should be creating a temporary variable to hold the string value returned by the Mid() function. I don't know yet how difficult it will be to resolve. In the interim, the solution is to introduce a temporary variable manually as you suggested.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2493
Location: Portland, OR

Posted: 19 March 2006, 19:31 PM    Post subject: Reply with quote

The initial assessment of the problem was incorrect. The solution required a change to the firmware. A
Firmware Update has been posted.
Back to top
stevech



Joined: 23 Feb 2006
Posts: 656

Posted: 19 March 2006, 19:50 PM    Post subject: Reply with quote

Confirmed OK here.

Great support, thanks!
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