#PB_Compiler_Project constants

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
kenmo
Addict
Addict
Posts: 2032
Joined: Tue Dec 23, 2003 3:54 am

#PB_Compiler_Project constants

Post by kenmo »

It would be nice to have:

Code: Select all

#PB_Compiler_Project
#PB_Compiler_ProjectName
#PB_Compiler_ProjectPath
similar to #PB_Compiler_File, #PB_Compiler_Filename, #PB_Compiler_FilePath, because sometimes the main project folder (holding PBP file) is not the same as the source code folder.

The first constant would be most useful. The other two are just for convenience, could be derived like GetFilePart(#PB_Compiler_Project).
(All three would of course be "" if a file is compiled without any associated project.)


This way, if your project structure is like:
MyProject/MyProject.pbp
MyProject/Source/Main.pb
MyProject/Source/Images.pbi
MyProject/Images/Icon.png
then "Images.pbi" could reference "Icon.png" such as

Code: Select all

IncludeBinary #PB_Compiler_ProjectPath + "Images/Icon.png"

Not critical, just a request!
User_Russian
Addict
Addict
Posts: 1517
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: #PB_Compiler_Project constants

Post by User_Russian »

User avatar
kenmo
Addict
Addict
Posts: 2032
Joined: Tue Dec 23, 2003 3:54 am

Re: #PB_Compiler_Project constants

Post by kenmo »

Sorry! I did not see your post!
Amilcar Matos
User
User
Posts: 43
Joined: Thu Nov 27, 2014 3:10 pm
Location: San Juan, Puerto Rico

Re: #PB_Compiler_Project constants

Post by Amilcar Matos »

+1
Post Reply