Got an idea for enhancing PureBasic? New command(s) you'd like to see?
helpy
Enthusiast
Posts: 552 Joined: Sat Jun 28, 2003 12:01 am
Post
by helpy » Wed Oct 22, 2008 10:34 pm
Hello,
Besides the following constant ...
Code: Select all
#PB_Compiler_File : Full path and name of the file being compiled, useful for debug purpose.
... it would be helpful to have a constant with the full path to the actual file being compiled, ie.: #PB_Compiler_FilePath
With this constant it would be easier to handle nested include files!
Code: Select all
XIncludeFile #PB_Compiler_FilePath + "include_X.pbi"
XIncludeFile #PB_Compiler_FilePath + "..\include_Y.pbi"
cu, guido
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
helpy
Enthusiast
Posts: 552 Joined: Sat Jun 28, 2003 12:01 am
Post
by helpy » Wed Oct 22, 2008 10:56 pm
... aaaah ...
I found a way to do what I want with a little trick (mentioned in a
different topic ):
Code: Select all
Macro RXIncludeFile
XIncludeFile #PB_Compiler_File + "\..\" +
EndMacro
RXIncludeFile "include_X.pbi"
RXIncludeFile "..\include_Y.pbi"
RXIncludeFile "subDir\include_Z.pbi"
This I can use in every source file ... and it is always relative to the source file, where RXIncludeFile is used.
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
helpy
Enthusiast
Posts: 552 Joined: Sat Jun 28, 2003 12:01 am
Post
by helpy » Fri Oct 24, 2008 7:58 am
... a new include command (like the little macro in the post before) would be very helpful:
RXIncludeFile <RelativeFilePath> ... R[elative]XIncludeFile is always relative to the current source file ... this would be a nice and helpful alternative to XIncludeFile.
cu, guido
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
Kaeru Gaman
Addict
Posts: 4826 Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany
Post
by Kaeru Gaman » Fri Oct 24, 2008 8:14 am
I suggest an implementation of some #PB_Compiler_SourcePath
to be used in combination with IncludePath .
would be more consistent than adding a new command.
oh... and have a nice day.