Permanent include a source file with common functions etc.
Permanent include a source file with common functions etc.
Hi,
i would like to have the possibility to permanent include a Purebasic source file. The source contains common procedures, macros and other stuff which should be available for all other projects and source files. I think it could be setup in the settings and everytime you compile or run a file or project, the source will be loaded at first. That's also good for temporary testing. Of course, code completion should work as well.
Best regards
Uwe
i would like to have the possibility to permanent include a Purebasic source file. The source contains common procedures, macros and other stuff which should be available for all other projects and source files. I think it could be setup in the settings and everytime you compile or run a file or project, the source will be loaded at first. That's also good for temporary testing. Of course, code completion should work as well.
Best regards
Uwe
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Permanent include a source file with common functions et
Well, that's only one line, Xinclude "my file.pbi" and you can store that one-liner as a template.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: Permanent include a source file with common functions et
I often use a new file for testing. I would have to write this line everytime. And code completion wouldn't work as well.
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
Re: Permanent include a source file with common functions et
I'm not 100% sure about this, as I think auto completion for imported files can be enabled in the IDE settings.And code completion wouldn't work as well.
But it would be nice to have a certain directory in PBs home where one file, e.g. include.pbi is placed. You can edit this file and add as much other includes as you need/want.
It would act much like a classpath in Java, which wouldn't be bad IMHO.
cheers,
bembulak
bembulak
Re: Permanent include a source file with common functions et
@bembulak : IDE-Settings only for projects or opened files...
You can store macros, structures and constants in a .res (resident) file.
so your "standard-include" will be smaller and can always be open in a tab, so the autocomplete is functionally ...
But I agree with this request
You can store macros, structures and constants in a .res (resident) file.
so your "standard-include" will be smaller and can always be open in a tab, so the autocomplete is functionally ...
But I agree with this request

Re: Permanent include a source file with common functions et
With some big limitations. Well no, it isn't right. I would say for the moment it's simply broken since structures cannot contains dynamic arrays or similar dynamic objects.Bisonte wrote: You can store macros, structures and constants in a .res (resident) file.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: Permanent include a source file with common functions et
Here, a similar request with a workaround - at least for me.
http://www.purebasic.fr/english/viewtop ... =3&t=50824
http://www.purebasic.fr/english/viewtop ... =3&t=50824
Re: Permanent include a source file with common functions et
?? This trigger is not implemented yet ... (Windows) or I am blind and cannot find this trigger.Here, a similar request with a workaround - at least for me.
viewtopic.php?f=3&t=50824
Re: Permanent include a source file with common functions et
Do you have the next beta ?Bisonte wrote:?? This trigger is not implemented yet ... (Windows) or I am blind and cannot find this trigger.

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.

Re: Permanent include a source file with common functions et
Hello everyone,
A feature I would like to see in PureBasic it's Toolbox system similar to the one we have in MatLAB. In MatLAB, it's possible to set a Toolbox folder containing user defined function. At the compilation time the compiler search inside this folder for missing function before annoying the user about missing function.
In PureBasic, a similar system can handle any user defined constants, structures, macros, procedures, imports, etc. by it's self just by scanning the user defined Toolbox folder (or loading it after all standard libs).
Personally, I don't like to create residents and libs with TailBite or Moebius because each time Fred Update PureBasic, all of this stuff as to be recompiled over and over again. I have much more important things to do than recompiling these libs and res. Furthermore, on Linux with complete setup doing :
for each files it's a real pain in the ass.
So for the moment, I have created a ToolBoxManager but I still need to indicate the needed files. So it's not transparent for the user as it is in MatLAB but allow me to store all my 190 different sources files containing Imports, Structures, Procedures, etc. Personally, I can't work without this tool even if it's not perfect.
Best regards.
Guimauve
A feature I would like to see in PureBasic it's Toolbox system similar to the one we have in MatLAB. In MatLAB, it's possible to set a Toolbox folder containing user defined function. At the compilation time the compiler search inside this folder for missing function before annoying the user about missing function.
In PureBasic, a similar system can handle any user defined constants, structures, macros, procedures, imports, etc. by it's self just by scanning the user defined Toolbox folder (or loading it after all standard libs).
Personally, I don't like to create residents and libs with TailBite or Moebius because each time Fred Update PureBasic, all of this stuff as to be recompiled over and over again. I have much more important things to do than recompiling these libs and res. Furthermore, on Linux with complete setup doing :
Code: Select all
sudo mv /home/guimauve/the_path/the_lib /usr/share/purebasic/purelibraries/userlibraries/the_lib
So for the moment, I have created a ToolBoxManager but I still need to indicate the needed files. So it's not transparent for the user as it is in MatLAB but allow me to store all my 190 different sources files containing Imports, Structures, Procedures, etc. Personally, I can't work without this tool even if it's not perfect.
Best regards.
Guimauve
Last edited by Guimauve on Wed Aug 22, 2012 3:08 am, edited 1 time in total.
Re: Permanent include a source file with common functions et
+1Guimauve wrote:A feature I would like to see in PureBasic it's Toolbox system similar to the one we have in MatLAB.
The best preparation for tomorrow is doing your best today.
Re: Permanent include a source file with common functions et
Thats what I have in mindts-soft wrote:Do you have the next beta ?Bisonte wrote:?? This trigger is not implemented yet ... (Windows) or I am blind and cannot find this trigger.

-
- Addict
- Posts: 1675
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Permanent include a source file with common functions et
I don't see why having a template for "Xinclude filename.pbi" would not work.
I use Xinclude all the time in my project, and I use it for one file that has code to auto-kill the debugger window when I exit a test run.
The file with that code is NEVER open in my IDE.
No, you probably won't get code completion hints, but if these commands are standard enough that you use them all the time and are sick of typing them; shouldn't you know them anyway?
Although I agree having a more complete feature where we can get code-hints for include files, etc would be nice as well.
Having an option like this, could enable us to have a Standard Public Library like other languages that have code templates, and useful tools packaged by default. The community could come together and organize it as well, similar to some of the past projects people have started for "open source" code repositories. Define the coding style, how it should be commented, etc. The community could maintain an up-to-date and with new PB releases, the most recent one can be included.
It could even have an "update Library" function, where the most up-to-date file is stored on the PB web site server, and can be downloaded by IDE clients.
I use Xinclude all the time in my project, and I use it for one file that has code to auto-kill the debugger window when I exit a test run.
The file with that code is NEVER open in my IDE.
No, you probably won't get code completion hints, but if these commands are standard enough that you use them all the time and are sick of typing them; shouldn't you know them anyway?
Although I agree having a more complete feature where we can get code-hints for include files, etc would be nice as well.
Having an option like this, could enable us to have a Standard Public Library like other languages that have code templates, and useful tools packaged by default. The community could come together and organize it as well, similar to some of the past projects people have started for "open source" code repositories. Define the coding style, how it should be commented, etc. The community could maintain an up-to-date and with new PB releases, the most recent one can be included.
It could even have an "update Library" function, where the most up-to-date file is stored on the PB web site server, and can be downloaded by IDE clients.