另外,在D6上编制的程序在D5上运行是否能行?谢谢!

解决方案 »

  1.   

    Migrating from Delphi 5
    Although compatibility between Delphi 5 and 6 is quite good, there are a few minor issues you
    should be aware of as you make the move.
    Writable Typed Constants
    The default state of the $J compiler switch (also known as $WRITEABLECONST) is now off,
    where it was on in previous versions. This means that attempts to assign to typed constants will
    raise a compiler error unless you explicitly enable this behavior using $J+.
    Cardinal Unary Negation
    Prior to Delphi 6, Delphi used 32-bit arithmetic to handle unary negation of Cardinal type
    numbers. This could lead to unexpected results. Consider the following bit of code:
    var
    c: Cardinal;
    i: Int64;
    begin
    c := 4294967294;
    i := -c;
    WriteLn(i);
    end;
    In Delphi 5, the value of i displayed would be 2. Although this behavior is incorrect, you might
    have code that relies on this behavior. If so, you should know that Delphi 6 has corrected this
    issue by promoting the Cardinal to an Int64 prior to performing the negation. The final value of
    i displayed in Delphi 6 is 4294967294.