If in_IDE

Just starting out? Need help? Post your questions and find answers here.
User avatar
rndrei
Enthusiast
Enthusiast
Posts: 151
Joined: Thu Dec 28, 2023 9:04 pm

If in_IDE

Post by rndrei »

How to find out the program in IDE or not?
I thought it would be, something like that!?

Code: Select all

CompilerIf Not #PB_Compiler_Debugger
CompilerEndIf
User avatar
NicTheQuick
Addict
Addict
Posts: 1503
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: If in_IDE

Post by NicTheQuick »

I think you can use #PB_Editor_CreateExecutable for that. You can read more about it here: https://www.purebasic.com/documentation ... piler.html
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
infratec
Always Here
Always Here
Posts: 7576
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: If in_IDE

Post by infratec »

You have to check the compiler option editor constant, then you can use:

Code: Select all

CompilerIf Not #PB_Editor_CreateExecutable
  MessageRequester("Info", "Started from IDE")
CompilerEndIf
#PB_Compiler_Debugger works too if you always have the debugger enabled in the IDE (which is normally the case)
In the 'real' executable the debugger is never enabled.
User avatar
Piero
Addict
Addict
Posts: 863
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: If in_IDE

Post by Piero »

Isn't this worth a feature request?
Like:

Code: Select all

CompilerIf #PB_Running_TemporaryExecutable
  MessageRequester("Info", "Started from IDE")
CompilerEndIf
Axolotl
Enthusiast
Enthusiast
Posts: 798
Joined: Wed Dec 31, 2008 3:36 pm

Re: If in_IDE

Post by Axolotl »

have you tried this

Code: Select all

Macro IsAppRunningInsideIDE() 
  Bool(GetEnvironmentVariable("PUREBASIC_HOME") <> "") 
EndMacro 
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Post Reply