delphi debug conditionals

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

ImIn debug
   self.height:=500;
end

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

if debughook <> 0 then
  ShowMessage('In debug mode');
0
 
MaximKorobovCommented:
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');
end;

Open in new window

0
 
Paer ToernellAuthor Commented:
Thanx, very nice!
0
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.