delphi debug conditionals

I want to execute some code depending if i am i debug mode or not Like:

ImIn debug

Paer ToernellAsked:
Who is Participating?
Geert GOracle dbaCommented:
check the debughook variable

if debughook <> 0 then
  ShowMessage('In debug mode');
You can also try this code:

// declare this function at the top of your module
function IsDebuggerPresent: boolean; stdcall external 'kernel32.dll';

// how to use it
if IsDebuggerPresent then
    showmessage('Running from IDE');

Open in new window

Paer ToernellAuthor Commented:
Thanx, very nice!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.