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
Compiler Error with Constants

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



Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX

Posted: 24 December 2006, 1:55 AM    Post subject: Compiler Error with Constants Reply with quote

Here is a short example of the problem:
Code:
Private Const START   as UnsignedInteger = &H00

Public Function Func(ByVal address as UnsignedInteger) as Byte
   Func = 24
   ' only has warning if START=0 and condition is >= or <
   ' works if written as address >= (7 + START)
   ' this.bas:9: Warning: conditional expression is always true
   If address >= (START + 7) Then
      Func = 25
   End If
End Function

Sub Main()
   Debug.Print CStr(Func(2))
End Sub

It seems to be a problem with handling of constants but only in specific circumstances.
Back to top
dkinzer
Site Admin


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

Posted: 28 December 2006, 4:34 AM    Post subject: Reply with quote

The cause of this problem has been isolated and a solution has been implemented. It is currently in the process of being tested.
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