6
votes
Vote UpVote

Dynamic arrays — pure reference types, except when they’re not

Delphi Haven – A reasonable way to understand the semantics of dynamic arrays in Delphi is to recall the sort of code you might have used as a substitute before they where introduced in Delphi 4. Assuming only a single dimension to keep things simple, stage one would be to declare dummy static array type, together with a corresponding pointer type: type PRectArray = ^TRectArray; TRectArray = array[0..$FFFFF] of TRect; Allocation and reallocation may then be done using the appropriately-named ReallocMem routine. More exactly, you can use GetMem and FreeMem as well, though since ReallocMem can do both ...
Favorite? Off-Topic? CR @ 2009-12-09 19:40

Statistics

Visits: 680
Votes: 6
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Charles Ardour
jamiei
Mason Wheeler
miller
Tier777
vcldeveloper
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)