Re: Delphi 7/8 Language enhancements

From: Eric Grange (egrange_at_glscene.org)
Date: 11/29/03

  • Next message: Per Larsen: "Re: Delphi 7/8 Language enhancements"
    Date: Sat, 29 Nov 2003 09:20:59 +0100
    
    

    > You can do this (prettymuch) already -- Check "Assignable Typed
    > Constants" in the Compiler page of the Project Options, and you can do
    > this..

    Not really, the code you gave does not declare a local variable
    with a default value, but a global variable with a local scope,
    i.e it is equivalent to having:

    var
       S : string = 'This is long overdue!';

    procedure ThisIsLongOverDue;
    begin
       ShowMessage(S);
       s := 'And it can be changed';
       ShowMessage(S);
    end;

    with "S" being only accessible in "ThisIsLongOverDue".

    Eric


  • Next message: Per Larsen: "Re: Delphi 7/8 Language enhancements"

    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, ... > procedure ThisIsLongOverDue; ...
      (borland.public.delphi.non-technical)
    • Re: advice on package design
      ... > for following scope. ... the compiler would have to do ... the extra verbiage required just to declare X. ... Unfortunately this is also untrue in Ada. ...
      (comp.lang.ada)
    • Re: Properties
      ... Is there any reason why this would not work and not simplify the ... Why should I have to declare any variable most of the time? ... The reason you explicitly declare fields used by a property is that the ... compiler needs to know what the code in the property does. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: use of erf intrinsic
      ... while it is also legal to declare a referenced function ... within the calling functionor even block, a la classic FORTRAN, ... The implementation (compiler) is required to check that references ... If you use K&R1 syntax, the compiler is not required to detect ...
      (comp.lang.fortran)