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
Structures with BoundedStrings

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



Joined: 13 Nov 2005
Posts: 661

Posted: 22 September 2006, 1:32 AM    Post subject: Structures with BoundedStrings Reply with quote

I want to create a structure with BoundedStrings (two of them, just a few bytes long)

I want it to look like this:

Code:
Public Structure CID
   Public MID   as byte
   Public OID   as UnsignedInteger
   Public PNM   as BoundedString(6)
   Public PRev   as byte
   Public SerNum   as UnsignedLong
   Public MDT   as BoundedString(7)
End Structure


I want to allocate the structure in the main program, then fill the structure in a subroutine.

I allocate it like this:
Code:
Dim CIDInfo as CID


I want to pass it like this:

Code:
Public Sub MMCInfo(byRef CIDInfo as CID)


And when I do it, I get this error

Code:
Internal error: variable.cpp(2576), Rev 674: unsupported Based type, "MMC_API.bas" line 135


Are BoundedStrings not legal in a structure?


--------- As I test this further, it seems that I can not actually assign characters to the structures string element with the statement

Code:
CIDInfo.PNM = "test"


This is what generates the error code

-Tony
Back to top
spamiam



Joined: 13 Nov 2005
Posts: 661

Posted: 22 September 2006, 2:26 AM    Post subject: Reply with quote

Upon further testing, the structure is fine.

The problem occurs when passing it to the subroutine.

How does one pass a reference to a structure to a subroutine legally?

-Tony
Back to top
dkinzer
Site Admin


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

Posted: 22 September 2006, 3:16 AM    Post subject: Reply with quote

spamiam wrote:
How does one pass a reference to a structure to a subroutine legally?

Just as you have done. The problem only occurs when referencing string types in a structure passed to a procedure. This is another symptom of the problem that Steve reported yesterday. It has already been fixed.


Last edited by dkinzer on 17 November 2006, 18:56 PM; edited 1 time in total
Back to top
spamiam



Joined: 13 Nov 2005
Posts: 661

Posted: 22 September 2006, 12:29 PM    Post subject: Reply with quote

dkinzer wrote:
spamiam wrote:
How does one pass a reference to a structure to a subroutine legally?

Just as you have done. The problem only occurs when referencing string types in a structure passed to a procedure. This is another symptom of the problem that Steve reported yesterday. It has already been fixed.


I suspected that Steve's problem might be related to mine. I worked around it with global variables for now.

-Tony
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