Groups > Borland > Borland Delphi migration > from D5 to D2006: packed object problem




from D5 to D2006: packed object problem

from D5 to D2006: packed object problem
Mon, 26 Feb 2007 16:53:03 -000
Hi.
I have many large applications written in Delphi 5 (almost 1 milion lines of 
code),
some are very heavy in math calculus others in visual parts, some both.
I have lots of 'packed object' because I need to make sure it had a certain 
size plus I need
it to extend, but I couldn't classes due the time it takes to allocate 
memory.

[1] How to port packed object
Ex:
type
  PObjectRec = ^TObjectRec;
  TObjectRec = packed object(TStringRec)
    Obj : Pointer;
  end;

into D2006 ?

[2] Operator overload is the main reason for me to port into the new 
version,
but from some basic tests, I found out that I can't use it in object type.

type
  T2DPointA = packed array[0..1] of TMetric;
  T2DPoint_ = packed object
  public
    X, Y : TMetric;
  end;

type
  P2DPointA = ^T2DPointA;
  P2DPoint = ^T2DPoint;
  T2DPoint = packed object(T2DPoint_)
  public
    function Add(const Value : T2DPoint) : P2DPoint;
    function Sub(const Value : T2DPoint) : P2DPoint;
 end;

I want to port the Add and Sub into operator overload, to make more easy to 
write BIG geometric equations.
Is it possible ?

Thanks in advance
Alexandre

Post Reply
about | contact