Solved

delphi debug conditionals

Posted on 2011-02-14
3
642 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 37

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 10 4 55
Easy to use inventory management software 7 92
Automatic dictation/transcribing software 9 33
Application Crash 2 21
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.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
The viewer will learn common shortcuts with easy ways to remember them. The viewer will then learn where to find all of the keyboard shortcuts, how to create/change them, and how to speed up their workflow.
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.

785 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