Page 1 of 2

a new include command

Posted: Fri Mar 16, 2007 3:51 am
by minirop
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

Posted: Fri Mar 16, 2007 10:17 am
by srod
There's the command

Code: Select all

IncludePath
:!:

Posted: Fri Mar 16, 2007 1:09 pm
by minirop
srod wrote:There's the command

Code: Select all

IncludePath
:!:
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"

Posted: Fri Mar 16, 2007 3:27 pm
by ts-soft
Create a directory in the PB-Folder like "Includes" for standard-includes

Code: Select all

XIncludeFile #PB_Compiler_Home + "Includes\one.pb"
So no problems with the path.
See: http://www.purebasic.fr/english/viewtop ... ncludepack

Posted: Sun Mar 18, 2007 3:32 am
by Rescator
A way to set default include path in IDE prefs would be nice.

Posted: Sun Mar 18, 2007 1:55 pm
by Kaeru Gaman
Rescator wrote:A way to set default include path in IDE prefs would be nice.
second!

Posted: Sun Mar 18, 2007 10:27 pm
by minirop
and add a "include" directory and a command to fetch the file in it like in C or C++ :D

Posted: Mon Mar 19, 2007 10:07 am
by PB
Kaeru Gaman wrote:
Rescator wrote:A way to set default include path in IDE prefs would be nice.
second!
Third!

Re: a new include command

Posted: Sat Apr 07, 2007 3:06 am
by Dummy
minirop 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
It's really annoying how it works right now but changing this now will break all my codes xD

Posted: Sun Apr 08, 2007 12:45 pm
by Tipperton
Kaeru Gaman wrote:
Rescator wrote:A way to set default include path in IDE prefs would be nice.
second!
third!

Further:

Being able to set multiple include paths like this:

Code: Select all

c:\includes1;c:\includes2
would be nice.

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

Posted: Sun Apr 08, 2007 5:51 pm
by AND51
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.

Posted: Sun Apr 08, 2007 6:10 pm
by Dummy
AND51 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.
use JaPBe it has this feature in another way. Search for *.pbfl files ;)

Posted: Sun Apr 08, 2007 6:43 pm
by freak
The IDE will get proper project management someday as well. This makes more sense than a special command for this.

Posted: Sun Apr 08, 2007 7:21 pm
by dell_jockey
freak wrote:The IDE will get proper project management someday as well. This makes more sense than a special command for this.
Hi Timo,

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.

Posted: Sun Apr 08, 2007 7:32 pm
by ts-soft
AND51 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.
See here: http://www.purebasic.fr/german/viewtopi ... 379#146379
The Selfmade-Man :wink: