Subscribe to forum RSS Forum

Logarray in Delphi?

New Topic Post Reply

Page: 1

Author Post
Member
Registered: Jul 2008
Posts: 2
Hi.
I'm probably missing something obvious, but I can't find a logarray method for Delphi. There is for Java and .Net?

Regards

Claes Enskär
Administrator
Registered: Sep 2007
Posts: 132
Hello Claes,

The reason why Delphi has no LogArray method is that you cannot easily get a string representation of an arbitrary value. In Java and .NET you can simply call the toString/ToString method. It might be possible to do something with Delphi's RTTI in this case (as we do for LogObject). I added it to our feature request list.

If you are looking into logging an array of a specific type, you could also implement a custom logging routine. With newer versions of Delphi (I think since 2005 or 2006), you can implement so called helper classes which let you add new methods to existing classes. This way, it is quite simple to attach a new log method to the TSiSession class. An example of a helper class can be found here:

http://www.gurock.com/support/forum/topic-144.html

I'm happy to assist in implementing such a custom routine.
Member
Registered: Jul 2008
Posts: 2
Ok.

I'l try the classhelper solution.
(I'm primarily want to log only 1 or 2 array-types)

Regards
Claes Enskär

New Topic Post Reply

Page: 1