3

Does Delphi have a function similar to debug.print in VB, and if it does, how does one access the immediate window? Thanks.

7
  • also : stackoverflow.com/q/4873356/327083, stackoverflow.com/q/397934/327083 ... Commented 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)? Commented May 13, 2013 at 17:27
  • @Rob In VB Debug.Print does output to the immediate window Commented May 13, 2013 at 17:38
  • Bizarre dupe selection. Write to the console window? Debug.Print? Commented 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". Commented May 13, 2013 at 19:26

1 Answer 1

6

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).

Sign up to request clarification or add additional context in comments.

6 Comments

Or in third-party debug viewers, like SysInternals DebugView, which are useful when debugging outside of the IDE.
@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?
Write a helper to convert other types to string and then call OutputDebugString.
@Remy Lebeau, DbgView is not really a debugger. It will read debug strings from the processes not being debugged.
Thank you all for the help.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.