Delphi handles typed constants just like any variables.  The only difference
is typed constants can have an initial value, which you can then safely
change.  Don't worry about overwriting string memory because internally,
string variables are pointers to the string data.  So, changing the string
merely changes the pointer value.  String data is reference counted and the
string memory manager will know to free these data blocks when the reference
count drops to 0.

----- Original Message -----
From: "Alistair George" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 8:57 AM
Subject: [DUG]: Those const again


> Hi all.
> Thanks for enlightening me on use of const.
> But.....if a const is initialised like so:
> const FirstDir: string = '';
> Say another const is initialised eg NextConst then FirstDir:='I am now a
rather large
> string, whereas before i was length 0';
> There is no possibility of collision with NextConst is there? I would
> imagine not, but not knowing the way the assembler places it into memory
it
> could be a valid consideration.
> Thanks,
> Al+
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
>
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to