It is currently Tue Jun 18, 2013 10:03 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Nested IncludePath and opening nested (X)IncludeFile
PostPosted: Thu Dec 15, 2011 3:03 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:58 pm
Posts: 205
Hi there!

1.) IncludeFile and XIncludeFile should always be relative to the File's Path, they are called from, not from the main compiler-File.
Example showing the problem:

Code:
;File Main.pb:
IncludePath "MyFrame/"
  IncludeFile "Frame1/Inc.pb"
IncludePath ""

Code:
;File MyFrame/Frame1/Inc1.pb:
IncludeFile "var.pb" ;How should var.pb know, where it comes from?

A possibility to nest IncludePath would be nice too, perhaps using EndIncludePath to finish this (PB-steady syntax)

2.)
Code:
IncludeFile "Test.pb"
IncludePath "MyFrame/"
  IncludeFile "Frame1/Inc.pb"
IncludePath ""

DoubleClicking on Test.pb gets me to the file (it's opened in the ide)
DoubleClicking on Frame1/Inc.pb doesn't do so, since it's in a subfolder defined by IncludePath. Shouldn't be such a big problem to get this working, should it?

Greetings

Franky

_________________
Give Up everything but trying!


Top
 Profile  
 
 Post subject: Re: Nested IncludePath and opening nested (X)IncludeFile
PostPosted: Thu Dec 15, 2011 3:49 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Jul 09, 2011 7:57 am
Posts: 276
if i remember well, includefile just copy/paste the target file into the current file when you compile your code because purebasic compiler is limited to one file

example

AAA.pb
Code:
define variable.i = 1


BBB.pb
Code:
includefile "AAA.pb"

variable + 1


at the compilation, purebasic just gonna compile BBB.pb which will be transformed like this
Code:
define variable.i = 1 ;AAA.pb copied / pasted

variable + 1


thats why the relative path don't change.

sorry for my poor english.

_________________
http://www.mediafire.com/pbstuff


Top
 Profile  
 
 Post subject: Re: Nested IncludePath and opening nested (X)IncludeFile
PostPosted: Thu Dec 15, 2011 7:27 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 1587
Location: Berlin, Germany
Franky wrote:
1.) IncludeFile and XIncludeFile should always be relative to the File's Path, they are called from, not from the main compiler-File.
Example showing the problem:

Code:
;File Main.pb:
IncludePath "MyFrame/"
  IncludeFile "Frame1/Inc.pb"
IncludePath ""

Code:
;File MyFrame/Frame1/Inc1.pb:
IncludeFile "var.pb" ;How should var.pb know, where it comes from?


Using #PB_Compiler_FilePath will work as you want:
Code:
;File MyFrame/Frame1/Inc1.pb:
XIncludeFile #PB_Compiler_FilePath + "var.pb"

Regards, Little John

_________________
Math problems?
Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x].


Top
 Profile  
 
 Post subject: Re: Nested IncludePath and opening nested (X)IncludeFile
PostPosted: Thu Dec 15, 2011 8:05 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 2704
There was a request for this just four days ago..

viewtopic.php?f=3&t=48522


See here for an alternative:

viewtopic.php?f=3&t=43921

See here for caveat and suggested fix (posted to bug reports over a year ago)

viewtopic.php?f=4&t=44177

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye