Re: Delphi 7/8 Language enhancements

From: Nick Hodges (TeamB) (nickhodges_at_yahoo.com)
Date: 11/28/03


Date: Fri, 28 Nov 2003 14:38:12 -0600

On Fri, 28 Nov 2003 20:17:16 -0000, "Mark" <mailme@marrr.co.uk> wrote:

>procedure ThisIsLongOverDue;
>var
> S : string = 'This is long overdue!';
>begin
> ShowMessage(S);
>end;

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;

Nick Hodges - TeamB
Lemanix Corporation
Please always follow the newsgroup guidelines --
http://www.borland.com/newsgroups



Relevant Pages

  • Re: Delphi 7/8 Language enhancements
    ... > Constants" in the Compiler page of the Project Options, ... > procedure ThisIsLongOverDue; ...
    (borland.public.delphi.non-technical)
  • Re: Delphi 7/8 Language enhancements
    ... > Constants" in the Compiler page of the Project Options, ... the code you gave does not declare a local variable ... procedure ThisIsLongOverDue; ...
    (borland.public.delphi.non-technical)
  • Re: Delphi 7/8 Language enhancements
    ... > Constants" in the Compiler page of the Project Options, ... > procedure ThisIsLongOverDue; ... Why declare a const if it should be ... A modifiable const is a var. ...
    (borland.public.delphi.non-technical)
  • Re: Writing single bits to a file
    ... The 'const' keyword provides the same kind of benefit that prototypes ... enabling the compiler to warn you if it detects the fact that you ... I had not gone and more correctly fixed up the precedence heirarchy (unary ... I like to implement scripting languages for breakfast ...
    (comp.lang.c)
  • Re: const
    ... > const modifiers, ... willing to remove the const'ness with a cast, ... I don't know how good a cross-file compiler could be - it would have to be ... it's a guarantee by the programmer. ...
    (comp.programming)