Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 686
  • Last Modified:

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

0
Paer Toernell
Asked:
Paer Toernell
2 Solutions
 
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.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now