>From the help file:

Typed constants, unlike true constants, can hold values of array, record,
procedural, and pointer types.

In the default {$J+} compiler state, typed constants can have new values
assigned to them; they behave essentially like initialized variables. But if
the {$J–} compiler directive is in effect, typed constants cannot change
value at runtime; they are, in effect, read-only variables.

=================================
Patrick Dunford, Christchurch, NZ
http://pdunford.godzone.net.nz/
http://www.trainweb.org/ferrymead/


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of John Christenhusz
> Sent: Monday, 12 November 2001 12:30
> To: Multiple recipients of list delphi
> Subject: [DUG]: Const
>
>
> Hi all,
>
> Can anybody tell me the difference between the following two declarations
> and why you want to use the first one. The second one seems to use less
> memory!
>
>
>       const
>          sName : string = 'This is a test';
>
>
> and
>
>       const
>          sName  = 'This is a test';
>
>
>
> TIA
>
> John.
>
> ------------------------------------------------------------------
> ---------
>     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