Does Delphi have a function similar to debug.print in VB, and if it does, how does one access the immediate window? Thanks.
-
also : stackoverflow.com/q/4873356/327083, stackoverflow.com/q/397934/327083 ...J...– J...2013-05-13 17:10:41 +00:00Commented May 13, 2013 at 17:10
-
What makes you think debug output has anything to do with the immediate window (which in Delphi is known as the Evaluate/Modify window)?Rob Kennedy– Rob Kennedy2013-05-13 17:27:37 +00:00Commented May 13, 2013 at 17:27
-
@Rob In VB Debug.Print does output to the immediate windowDavid Heffernan– David Heffernan2013-05-13 17:38:13 +00:00Commented May 13, 2013 at 17:38
-
Bizarre dupe selection. Write to the console window? Debug.Print?David Heffernan– David Heffernan2013-05-13 18:10:02 +00:00Commented May 13, 2013 at 18:10
-
1@DavidHeffernan the use case and feature need are basically identical. The only difference is in the wording - one guy is asking for "console" output, this guy is asking for an "immediate window". It seems clear that they are both looking for the standard thing that is "that feature in this IDE whereby my application can output strings to a box such that I might monitor them whilst debugging".J...– J...2013-05-13 19:26:22 +00:00Commented May 13, 2013 at 19:26
|
Show 2 more comments
1 Answer
You can call the Windows API function OutputDebugString. Anything that is sent to that function appears in the Event Log window in the IDE (View | Debug Windows | Event Log).
6 Comments
Remy Lebeau
Or in third-party debug viewers, like SysInternals DebugView, which are useful when debugging outside of the IDE.
user2378627
@David, thanks! It really helps. I suppose it's only for string values? Can I print a value, eg enumerated type, to debug window as well?
David Heffernan
Write a helper to convert other types to string and then call OutputDebugString.
OnTheFly
@Remy Lebeau, DbgView is not really a debugger. It will read debug strings from the processes not being debugged.
user2378627
Thank you all for the help.
|