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
arrays of strings - memory release

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



Joined: 23 Feb 2006
Posts: 656

Posted: 17 September 2006, 22:47 PM    Post subject: arrays of strings - memory release Reply with quote

may be a dumb question, but...
in this example:

dim myStrings(0 to 5) as string
...
myStrings(n) = cstr(x)
myStrings(n) = cstr(y)

will the storage for the string be automatically recovered each time that array element is rewritten?

(the code is just illustrative)
Back to top
dkinzer
Site Admin


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

Posted: 17 September 2006, 22:58 PM    Post subject: Re: arrays of strings - memory release Reply with quote

stevech wrote:
will the storage for the string be automatically recovered each time that array element is rewritten?

Yes, just as it is for a scalar String variable. Moreover, memory is freed for string variables when they go out of scope.
Back to top
stevech



Joined: 23 Feb 2006
Posts: 656

Posted: 17 September 2006, 23:43 PM    Post subject: Reply with quote

VM-Power!!!
Back to top
dkinzer
Site Admin


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

Posted: 18 September 2006, 1:07 AM    Post subject: Reply with quote

stevech wrote:
VM-Power!!!

The freeing upon subsequent assignment is performed by the VM. The freeing when going out of scope is realized by code generated by the compiler. You can see the generated instructions in the listing file.
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