a new include command
a new include command
hi !
It would be great if including a file was made from the "includer" and not from the root file like in C.
example :
my files are :
main.pb
include\one.pb
include\two.pb
if one.pb include two.pb like this :
IncludeFile "two.pb"
and if in main.pb I do :
IncludeFile "one.pb"
PB will look for :
%DIR%\two.pb and not for %DIR%\include\two.pb
++
edit :
or create "include paths" and includeFile will look in each paths referenced for the file
It would be great if including a file was made from the "includer" and not from the root file like in C.
example :
my files are :
main.pb
include\one.pb
include\two.pb
if one.pb include two.pb like this :
IncludeFile "two.pb"
and if in main.pb I do :
IncludeFile "one.pb"
PB will look for :
%DIR%\two.pb and not for %DIR%\include\two.pb
++
edit :
or create "include paths" and includeFile will look in each paths referenced for the file
I know it, i'ts not what I looking for, but I managed to solve the problem by putting the "include path" in "one.pb"srod wrote:There's the commandCode: Select all
IncludePath
Create a directory in the PB-Folder like "Includes" for standard-includes
So no problems with the path.
See: http://www.purebasic.fr/english/viewtop ... ncludepack
Code: Select all
XIncludeFile #PB_Compiler_Home + "Includes\one.pb"
See: http://www.purebasic.fr/english/viewtop ... ncludepack
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: a new include command
It's really annoying how it works right now but changing this now will break all my codes xDminirop wrote:hi !
It would be great if including a file was made from the "includer" and not from the root file like in C.
example :
my files are :
main.pb
include\one.pb
include\two.pb
if one.pb include two.pb like this :
IncludeFile "two.pb"
and if in main.pb I do :
IncludeFile "one.pb"
PB will look for :
%DIR%\two.pb and not for %DIR%\include\two.pb
++
edit :
or create "include paths" and includeFile will look in each paths referenced for the file
third!Kaeru Gaman wrote:second!Rescator wrote:A way to set default include path in IDE prefs would be nice.
Further:
Being able to set multiple include paths like this:
Code: Select all
c:\includes1;c:\includes2
To avoid breaking current set ups, the compiler could first look in the source file's directory for the file, and only search the paths if the include file doesn't exist there. Or users could just set up the include paths as:
Code: Select all
.;c:\includes1;c:\includes2
Hey Fred! And all others!
I know, if you double click on a (X)IncludeFile, the include file will be opened in a new tab.
What about a include command, that advises the IDE automatically to open the include, when the main maodule is being loaded? This can be useful, when your source has got several thousand lines and you've got include commands all over the code.
What do you think? This possibility makes you able to load all dependant files, belonging to the project when just opening the main file.
I know, if you double click on a (X)IncludeFile, the include file will be opened in a new tab.
What about a include command, that advises the IDE automatically to open the include, when the main maodule is being loaded? This can be useful, when your source has got several thousand lines and you've got include commands all over the code.
What do you think? This possibility makes you able to load all dependant files, belonging to the project when just opening the main file.
PB 4.30
Code: Select all
onErrorGoto(?Fred)
use JaPBe it has this feature in another way. Search for *.pbfl filesAND51 wrote:Hey Fred! And all others!
I know, if you double click on a (X)IncludeFile, the include file will be opened in a new tab.
What about a include command, that advises the IDE automatically to open the include, when the main maodule is being loaded? This can be useful, when your source has got several thousand lines and you've got include commands all over the code.
What do you think? This possibility makes you able to load all dependant files, belonging to the project when just opening the main file.

-
- Enthusiast
- Posts: 767
- Joined: Sat Jan 24, 2004 6:56 pm
Hi Timo,freak wrote:The IDE will get proper project management someday as well. This makes more sense than a special command for this.
that's very good news indeed! In that case, please also include some sort of version control. I don't need a complete VCS. Something along the lines of what LCCWin32's WEdit offers would do quite nicely.
See here: http://www.purebasic.fr/german/viewtopi ... 379#146379AND51 wrote: What do you think? This possibility makes you able to load all dependant files, belonging to the project when just opening the main file.
The Selfmade-Man

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
