Re: Delphi 7/8 Language enhancements

From: Mark (mailme_at_marrr.co.uk)
Date: 11/28/03


Date: Fri, 28 Nov 2003 21:08:51 -0000


"Nick Hodges (TeamB)" <nickhodges@yahoo.com> wrote in message
news:6gcfsv825rq9igglji35b7j56j9ca5redl@4ax.com...
> On Fri, 28 Nov 2003 20:17:16 -0000, "Mark" <mailme@marrr.co.uk> wrote:

> You can do this (prettymuch) already -- Check "Assignable Typed
> Constants" in the Compiler page of the Project Options, and you can do
> this..
>
> procedure ThisIsLongOverDue;
> const
> S : string = 'This is long overdue!';
> begin
> ShowMessage(S);
> s := 'And it can be changed';
> ShowMessage(S);
> end;
>

I've always resisted doing this in my code... i always felt it was a compiler
bug or hack (maybe one day in the distant past it was!) The fact that it not
supported by default suggests that my suspicion may be correct... and also that
this feature may be removed in a future version of Delphi. Does D8 let you do
this, btw?

It can make code look cleaner if you want to assign default values to a lot
variables or an array, but it seems strange that you can do this with global
variables, but not local variables.