Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 681
  • 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 GruwezOracle 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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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