Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detect running from IDE
#1
I regularly want to know if I'm running from the IDE (during development) or not.
To set the current working directory correct or to stop with End instead of System
etc.

I now use this code which seems to work for some time already:

Code: (Select All)
Dim Shared DEVELOPMENT As _Byte
$If WIN Then
  DEVELOPMENT = (Environ$("sessionname") = "Console"): If Not DEVELOPMENT Then ChDir _StartDir$
$End If
'...
If DEVELOPMENT Then End Else System
But is this a correct/reliable way? Where does sessionname=Console come from and will it stay like this in future versions?
I would love to have a _DEVELOPMENT variable out-of-the-box as part of QB64pe

Sidenote: Why is _CWD not correct initialized when not running from the IDE; It then points to the directory containing your exe instead
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience
Reply


Messages In This Thread
Detect running from IDE - by mdijkens - 02-11-2024, 09:19 AM
RE: Detect running from IDE - by FellippeHeitor - 02-12-2024, 02:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  IDE Colors Dimster 10 723 12-02-2025, 03:05 PM
Last Post: Kernelpanic
  Running QB64 v2 InForm Programs on PE Magdha 2 354 11-19-2025, 11:10 AM
Last Post: Magdha
  Make IDE $Console:Only output readably large dakra137 1 523 10-10-2025, 12:21 PM
Last Post: hsiangch_ong
  Why is 'option' treated like a reserved word in the IDE? Pete 2 557 04-11-2025, 10:03 PM
Last Post: Pete
  Why is 'base' treated like a reserved word in the IDE? Pete 4 786 04-11-2025, 09:49 PM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: