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
Problem with a subroutine call

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



Joined: 13 Nov 2005
Posts: 689

Posted: 04 August 2006, 22:55 PM    Post subject: Problem with a subroutine call Reply with quote

I have a set of modules that used to compile and work (as far as I can recall) and I am now getting an error on compile. It is a set of modules using driving a sparkfun LCD display.

I just upgraded the compiler and VM to the newest versions. I think I was 2 versions outdated previously.

I get the following error:

Quote:
ZX_SF_LCD_API.bas:175: Error: reference to undefined identifier "ClearDisplay"


The program line in question is:

Code:
Public Sub LCDClearScreen()

    Call LCDPutCommand(ClearDisplay)

End Sub


I have defined the identifier in the same module with:

Code:
Public Enum LCDCommandType
    ClearDisplay      = 1
    Set20CharWide      = 3
   Set16CharWide      = 4
   Set4Lines         = 5
   Set2Lines         = 6
   HitachiCommand        = 17
   SetGeometryCmd       = 124
    SetCursorPositionCmd = 128
End Enum


And the subroutine is defined in another module in the same project as:

Code:
Public Sub LCDPutCommand(ByVal Value As LCDCommandType)

 'This procedure transmits an LCD-specific command to the device.

    Dim Temp As Byte

    Temp = CByte(Value)
   Call PutQueueByte(OutPutQueue, 254)
    Call PutQueueByte(OutputQueue, Temp)

End Sub


I do not see why this will not compile properly! And it used to!

-Tony
Back to top
dkinzer
Site Admin


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

Posted: 05 August 2006, 0:08 AM    Post subject: Reply with quote

The test code below compiles without errors or warnings using v1.2.7 of the compiler (the latest published). As far as I can tell, it embodies the elements that you described.
Code:
Public Enum LCDCommandType
   ClearDisplay         = 1
   Set20CharWide        = 3
   Set16CharWide        = 4
   Set4Lines            = 5
   Set2Lines            = 6
   HitachiCommand       = 17
   SetGeometryCmd       = 124
   SetCursorPositionCmd = 128
End Enum

Sub Main()
   Call LCDPutCommand(ClearDisplay)
End Sub

Public Sub LCDPutCommand(ByVal Value As LCDCommandType)
   Debug.Print CStr(Value)
End Sub

If you could send me the code by email (in a .zip, please), I can figure out what's going on. Alternately, you may want to distill the code down to a simple test case, like that above, that demonstrates the problem.
Back to top
dkinzer
Site Admin


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

Posted: 05 August 2006, 21:49 PM    Post subject: Reply with quote

The source of the problem has been located and the error has been fixed. We plan to post a compiler update within the next few days that will resolve this issue.
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