What is the fundamental difference between adding an existing file to a project and just including it with an XInclude?
Either way, a file can be reused in multiple projects.
It makes no difference to an Executable.
Searching (eg for a variable name) is within file anyway, so no difference there.
So I think there must be a concept I am missing.
Maybe (as a newcomer to PB) it is the way I am starting to arrange my projects?
Add file to project versus XInclude in the IDE
Add file to project versus XInclude in the IDE
Ubuntu 22.04 64-bit
Purebasic 6.00 (as of 5 Sep 2022)
(native tongue: English)
Purebasic 6.00 (as of 5 Sep 2022)
(native tongue: English)
Re: Add file to project versus XInclude in the IDE
It changes the behaviour of the IDE, although you may have to alter your IDE preferences to see this fully in action.eck49 wrote:What is the fundamental difference between adding an existing file to a project and just including it with an XInclude?
When you use a project file you can tell the IDE to scan selected files, or all files, in the project for autocomplete information.
The files will be scanned regardless of whether or not they are open in the IDE. Without a project only the current file or open files will be scanned. This means you can still benefit from autocomplete without having to have dozens of tabs open in the IDE. The larger the project, the more important this becomes.
A project allows you to define multiple targets for compilation. This could be useful if your project produces more than one separate executable sharing some source files, produces both 32 and 64-bit versions, or if you want to target more than one version of the compiler, for example.
But yes, you are correct, you will still have to use (X)Include at some stage even if you are using a project file.
Have you seen the 'Find in files' option on the Edit menu?eck49 wrote:Searching (eg for a variable name) is within file anyway, so no difference there.
Re: Add file to project versus XInclude in the IDE
@Spikey, thank you for your response.
Ah, autocomplete.
So far, I have needed to have every file open so I can search for how I did something just a few days ago - or whether the already-invented wheel I am wanting is lurking in code I have downloaded from the forum! But once I am more confident, I can see how autocompleting from files which are not open could be very powerful.
Edit: no I had not noticed Find in Files... until now.
Ah, autocomplete.
So far, I have needed to have every file open so I can search for how I did something just a few days ago - or whether the already-invented wheel I am wanting is lurking in code I have downloaded from the forum! But once I am more confident, I can see how autocompleting from files which are not open could be very powerful.
I don't think this will be useful to me, but I can see its potential for the wider clientele.A project allows you to define multiple targets for compilation
Edit: no I had not noticed Find in Files... until now.
Ubuntu 22.04 64-bit
Purebasic 6.00 (as of 5 Sep 2022)
(native tongue: English)
Purebasic 6.00 (as of 5 Sep 2022)
(native tongue: English)
Re: Add file to project versus XInclude in the IDE
Off the top of my head... adding files to project:
- scans them for Auto-complete
- when you Build/Run on a project file, the IDE knows to build the project (not the individual include file)
- loading a project will warn you if a linked file has been changed externally
- files listed in the "Project" tab - double-click a file to open it
... maybe more?
But really, with PureBasic, you don't need to configure a "project" unless your project gets big enough, or you want to build different variants.
It's one of the things I love about PB unlike some languages... project not required... just start typing and hit F5 to go!
- scans them for Auto-complete
- when you Build/Run on a project file, the IDE knows to build the project (not the individual include file)
- loading a project will warn you if a linked file has been changed externally
- files listed in the "Project" tab - double-click a file to open it
... maybe more?
But really, with PureBasic, you don't need to configure a "project" unless your project gets big enough, or you want to build different variants.
It's one of the things I love about PB unlike some languages... project not required... just start typing and hit F5 to go!