I tried replying to your message, but I got bounced by the list server.

Here's my response:

You're talking about a specific flavour of constant called a 'typed
constant'.

I use them from time to time for reasonably static information.  As the help
says, they behave essentially like initialised variables.

Whether or not they're modifiable depends on the {$J} compiler switch.

It is perfectly valid to use them as you describe below, so I believe you
can rely on the compiler, etc. to handle any potential collision.

I've never had a problem with typed constants.

HTH,

Conor

-----Original Message-----
From: Alistair George [mailto:[EMAIL PROTECTED]
To: Multiple recipients of list delphi

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