Solved

delphi debug conditionals

Posted on 2011-02-14
3
627 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
3 Comments
 
LVL 36

Accepted Solution

by:
Geert Gruwez earned 125 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 125 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
This video demonstrates how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now