Better debug for scripts?

Make a request or discuss new features.
Post Reply
User avatar
pjj
Posts: 2108
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Better debug for scripts?

Post by pjj »

Since I have your attention today 8) one more feature request.

I've been trying to concoct another script today, or rather an extension, and have a really hard time trying to figure things out. Sample code fro the help file seemed not to work, so I was fumbling in the dark. Sadly, the only debugging tool we have right now is ShowMessage(), which is rather limited. Would it be possible to have something like PHP's var_dump() function, spitting its output into Messages panel?

Herb are two links I found; perhaps they will be useful to you:
https://github.com/correaelias/TypeUtils
https://stackoverflow.com/questions/923 ... -in-delphi
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
Rickard Johansson
Site Admin
Posts: 6575
Joined: 19 Jul 2006 14:29

Re: Better debug for scripts?

Post by Rickard Johansson »

Added script function "MainApp.OutputDebugString(const text: string; value: Variant)" in next release.

"value" can be an integer, float, date, boolean or string. It's written to the message panel as text + ' ' + value.

Hope that helps a little :?
User avatar
pjj
Posts: 2108
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: Better debug for scripts?

Post by pjj »

Cool! Thanks a lot! :-D

Will it work with objects, though, like e.g. TElMainMenu? E.g.

Code: Select all

ShowMessage(TElMenuItem.Items); 
brings up message "not enough parameters" and then I'm stuck, getting "index required", "undeclared identifier", "not enough parameters" or null response for various crazy combinations I tried out. Or a nice access violation :roll:
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
Post Reply