Delphi and Kylix

Moderators: pritaeas
Number of threads: 7244
Number of posts: 19051

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
dynamic arrays Posted by der_ranga on 7 Feb 2005 at 9:43 AM
Thanks Zib i was able to create and manipulate the dynamic array as you postd. I was just wondering what exactly happens to the memory used by the array. If the dynamic array is declared locally to a procedure or function; after the procedure/ function has exited does the memory used by the dynamic array get destroyed?

If the dynamic array is declared globally how do you empty the array is it as simple as setting the array length to 0?

setlength(DynArray,0);

Cheers Lee
Report
Re: dynamic arrays Posted by zibadian on 7 Feb 2005 at 4:17 PM
: Thanks Zib i was able to create and manipulate the dynamic array as you postd. I was just wondering what exactly happens to the memory used by the array. If the dynamic array is declared locally to a procedure or function; after the procedure/ function has exited does the memory used by the dynamic array get destroyed?
:
: If the dynamic array is declared globally how do you empty the array is it as simple as setting the array length to 0?
:
: setlength(DynArray,0);
:
: Cheers Lee
:
I don't know where it will reside. It is best to deallocate it using SetLength(), Finalize(), or Free method depending on the element types involved.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.