Forum Index
Compiler Error with Constants

 
Author Message
mikep



Joined: 24 Sep 2005
Location: Austin, TX

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

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
Location: Portland, OR

Posted: 28 December 2006, 4:34 AM    Post subject:

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:   
Page 1 of 1

 



ZBasic Microcontrollers Home
All content Copyright © 2005, 2006, 2007, 2008, 2009, 2010 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