[Implemented] Compiler constants #PB_Compiler_IsMain

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

[Implemented] Compiler constants #PB_Compiler_IsMain

Post by helpy »

Hallo PB Team,

It would be helpful to know at compile time if a file is used as include or as main file:

Suggestions:
  • #PB_Compiler_Main ... is #True if source file is used as main file
  • #PB_Compiler_Include ... is #True if source file is used as include file
Other possibilities:
  • #PB_Compiler_IsMain
  • #PB_Compiler_UsedAsMain
  • #PB_Compiler_IsInclude
  • #PB_Compiler_UsedAsInclude
greetings to the great PB team.

cu,
guido
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Compiler constants #PB_Compiler_IsMain or similar ...

Post by blueznl »

Yep, this one I would like as well. It would allow to put 'test' procedures inside an include file, which would not be included if the include is an include... euh... hope that makes sense :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Compiler constants #PB_Compiler_IsMain or similar ...

Post by ts-soft »

blueznl wrote: inside an include file, which would not be included if the include is an include... euh...
Yes, i agree :D
Post Reply