[Implemented] New compiler constant: #PB_Compiler_Name

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

[Implemented] New compiler constant: #PB_Compiler_Name

Post by blueznl »

We do have #PB_Compiler_File, but what I would like to add is 'module testing'. I would like to test my include files by 'running' them, ie. I need to know if they are included or directly run. This could be accomplished by the following:

Code: Select all

Procedure Test()
  ;
  ;
  CompilerIf #PB_Compiler_Name = "x_lib.pb"
    ;
  EndCompilerIf
EndProcedure
The current implementation forces me to include a complete path, which I obviously don't want :-)
( 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... )
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Re: New compiler constant: #PB_Compiler_Name

Post by traumatic »

I got the idea but I'd expect #PB_Compiler_Name to output "Purebasic 4.xx" or something.
Maybe #PB_Compiler_Module or the like would fit better. Just my 2ct.
Good programmers don't comment their code. It was hard to write, should be hard to read.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

You may be right. I was just trying to match the current #PB_Compiler_File and #PB_Compiler_Path statements.
( 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... )
Post Reply