Working with projects
Working with projects
Hi!
Im new with PureBasic, although a long, long, time programming with various Basics.
There is a thing that is driving me crazy, but I guess it has to be a really silly thing.
I have created a Proyect, with 2 files, MAIN, and SECOND
Both files are in the proyect (or so I think), but I can not call PROCEDURES created in SECOND from MAIN program.
If I type in MAIN, autocomplete finds the procedure created in SECOND, but after I click RUN, I got the error "MyProc() is not a function,..."
What am I doing wrong?
Im new with PureBasic, although a long, long, time programming with various Basics.
There is a thing that is driving me crazy, but I guess it has to be a really silly thing.
I have created a Proyect, with 2 files, MAIN, and SECOND
Both files are in the proyect (or so I think), but I can not call PROCEDURES created in SECOND from MAIN program.
If I type in MAIN, autocomplete finds the procedure created in SECOND, but after I click RUN, I got the error "MyProc() is not a function,..."
What am I doing wrong?
- StarBootics
- Addict
- Posts: 984
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: Working with projects
Hello,
Did you put in your MAIN file IncludeFile "SECOND" file ?
Best regards
StarBootics
Did you put in your MAIN file IncludeFile "SECOND" file ?
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Re: Working with projects
Yes, it did the work.
Thank you.
(I though it would be automatically included)
Thank you.
(I though it would be automatically included)
Re: Working with projects
The files to be included in a project are not automatically included because it can be done conditionally (i.e. depending on the type of CPU) since a project can compile several versions at the same time.AMpos wrote:(I though it would be automatically included)
PS. Also prefer XInclude to Include.
Code: Select all
; Main.pb
CompilerIf #PB_Compiler_Processor = #PB_Processor_x64
XIncludeFile "Second_x64.pbi"
CompilerElse
XIncludeFile "Second_x86.pbi"
CompilerEndIf
Re: Working with projects
I have this
/Purebasic
//MyProyect
...main.pb
...tobeincluded.pb
//CommonFunctions
...Zones.pb
I can add "zones.pb" to my proyect, but how do I include it?
How do I include it? Will
INCLUDE "zones.pb"
works, as it is added to the proyect, or have I to include with full/relative path?
/Purebasic
//MyProyect
...main.pb
...tobeincluded.pb
//CommonFunctions
...Zones.pb
I can add "zones.pb" to my proyect, but how do I include it?
How do I include it? Will
INCLUDE "zones.pb"
works, as it is added to the proyect, or have I to include with full/relative path?
Re: Working with projects
The files you add in the Project Manager are just data that allows the IDE to know for example which scanner files to use for the variable list.
It's just the main project file must contain XInclude lines
It also allows you to launch the compilation of the project even if you are not editing the main file.
If the files to be included are in different directories from the main file, then you must specify the path (absolute or relative)
i.e Main.pb
PS Avoid full path as this cause problem if you move project in future.
It's just the main project file must contain XInclude lines
It also allows you to launch the compilation of the project even if you are not editing the main file.
If the files to be included are in different directories from the main file, then you must specify the path (absolute or relative)
i.e Main.pb
Code: Select all
XInclude "Second.pb"
XInclude "..\tobeincluded.pb"
XInclude "C:\Zones.pb"
; The main code
Re: Working with projects
Damm... my purebasic programs are in a google drive folder, so they are updated between my computers... so, the full path is not the same always...
Re: Working with projects
I don't use Google Drive, but it should be possible to map a resource such as a network drive or by UNCAMpos wrote:Damm... my purebasic programs are in a google drive folder, so they are updated between my computers... so, the full path is not the same always...
Other solution: synchronize local and remote (RoboCopy, Syncbackup) or even create a local GIT repository on Google Drive ?
Re: Working with projects
Google Drive has itself a synchronice program but the path is "C:\Users\oneuser\Google Drive" and in another computer, "C:\Users\otheruser\Google Drive"
I will try using
INCLUDE "../CommonFuntions/zones.pb"
perhaps it works...
I will try using
INCLUDE "../CommonFuntions/zones.pb"
perhaps it works...
Re: Working with projects
No problem. You can map a drive letter to a local directory on each PC ("Net use" works on local using \\localhost as "server" name)AMpos wrote:Google Drive has itself a synchronice program but the path is "C:\Users\oneuser\Google Drive" and in another computer, "C:\Users\otheruser\Google Drive"
Code: Select all
NET USE Z: "\\localhost\Users\oneuser\Google Drive"