Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

delphi debug conditionals

Posted on 2011-02-14
3
Medium Priority
?
677 Views
Last Modified: 2013-12-12
I want to execute some code depending if i am i debug mode or not Like:

ImIn debug
   self.height:=500;
end

0
Comment
Question by:Sunsales
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 38

Accepted Solution

by:
Geert Gruwez earned 500 total points
ID: 34887240
check the debughook variable

if debughook <> 0 then
  ShowMessage('In debug mode');
0
 
LVL 2

Assisted Solution

by:MaximKorobov
MaximKorobov earned 500 total points
ID: 34887869
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
 

Author Closing Comment

by:Sunsales
ID: 34887879
Thanx, very nice!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was originally published on Monitis Blog, you can check it here . If you have responsibility for software in production, I bet you’d like to know more about it. I don’t mean that you’d like an extra peek into the bowels of the sourc…
If you're a modern-day technology professional, you may be wondering if certifications are really necessary. They are. Here's why.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses

647 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question