🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.components.usage
Article #6

Type conversion while debugging

#6
From: Dominik L�bbers
Date: Wed, 03 Feb 1999 00:00
41 lines
1998 bytes
Since a few weeks I use Delphi 4 (German, Update Pack #2).
I noticed a strange behaviour while debugging the following code:

{$OPTIMIZATION OFF}
procedure TForm1.Button2Click(Sender: TObject);
var
  l: TList;
  a: TAdresse;
  p: Pointer;
begin
  l := TList.Create;
  try
    a := TAdresse.Create('Smith', 'Washington');
    l.add(a);
    p := l[0];
  finally
    l.Free; /* set the breakpoint here */
  end;
end;

When you run the program that contains this method and let it stop at
the
shown position, you can inspect the following expressions:
1) l[0]
2) TAdresse(l[0])
3) p
4) TAdresse(p)
Since p is given the value of l[0] both variables should behave in the
same way.
But they don't. l[0] is evaluated correctly and contains the same value
as p.
But while the type conversion of p to TAdresse is possible and shows
('Smith', 'Washington')
the debugger is not able to inspect the second expression
(TAdresse(l[0]).
Why is the same type conversion as in No. 4 impossible in this
situation?

Thanks for any help

Dominik Luebbers
Technical Details
Message-ID: <36B82502.61A44BA8@pool.informatik.rwth-aachen.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb0ea,b0fbba8c330bf037,start
X-Google-Attributes: gidfb0ea,public
X-Google-Thread: f973b,b0fbba8c330bf037,start
X-Google-Attributes: gidf973b,public
X-Google-Thread: 10baee,b0fbba8c330bf037,start
X-Google-Attributes: gid10baee,public
X-Google-Thread: 10545b,b0fbba8c330bf037,start
X-Google-Attributes: gid10545b,public
From: "Dominik L�bbers" <dominik@pool.informatik.rwth-aachen.de>
Subject: Type conversion while debugging
Date: 1999/02/03
Message-ID: <36B82502.61A44BA8@pool.informatik.rwth-aachen.de>
X-Deja-AN: 440133026
Content-Transfer-Encoding: 7bit
Organization: Aachen University of Technology / Rechnerbetrieb Informatik
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: comp.lang.pascal.delphi.components.usage,comp.lang.pascal.delphi.misc,borland.public.delphi.ide,borland.public.delphi.vcl.components.using