Page 1 of 1

Consistent method for PB Include and libs

Posted: Sun Sep 28, 2008 6:17 am
by localmotion34
With 4.30B2 out, I am in the process of migrating and updating quite alot of code from previous versions.

Over the years, all my code examples from my writing and the forum have become a total mess, and I am trying to organize them all together.

Additionally, because PB has broken the userlib format a few times, PB users are now switching to releasing .pbi files. This is actually fine with me, but library sets like Nexus have a main include file, which then includes quite a few other .pbi files.

Also, since I have become more proficient with C and ASM, I have been able to make static libs for use with PB. Alot of my code now depends on Libs. So my folders not only have .pb files, but have .lib and .obj littered about.

What I am asking for is a mix of the Japbe setup and something new. I'd like a directory in the main PB folder called "Includes", with subfolders "Static" and "Residents".

Accessing the PB Include folder could be done like Japbe by checking checkboxes which then automatically include the file. OR, a constant called "#PB_Include_Path", #PB_Residents_Path and #PB_StaticLib_Path

Includefile #PB_include_Path +"Droopy.pbi"

Import #PB_StaticLib_Path + "AniGIFlib.lib"

This method would allow any PB user to write .pbi files, ane be COMPLETELY CONSISTENT for ALL PB users when distributing. All users would have to do is put the .pbi file and static libs into the proper directories and just use a single include line. Even if a .pbi file includes other .pbi files in subfolders. Additionally, user can then modify the EDITABLE .pbi files to suit their needs.

EX:

Code: Select all

Includefile #PB_include_Path +"Droopy\Droopy.pbi"

Includefile #PB_Residents_Path +"Droopy\Droopy_Res.pbi"

Import #PB_StaticLib_Path + "GIFlibraries\AniGIFlib.lib"

Procedure This (that.l)

Procedure AniGIFControl(hwnd)
The above .pbi format would let ANYONE get going right away using it without having to modify tons of source lines.

My Biggest problem is that I have 2 workstations and a laptop that I program on where i synchronize my PB folders. When on my laptop, all the paths get waaay screwed up because of different drive letters. With this system above, the Include and LIB paths are FIXED and CONSISTENT.

The whole userlib thing seems to be inefficient anymore. I am asking for a UNIFIED and STANDARD way to setup includes and share workable code.

If not, can there be at least a subforum SPECIFICALLY for userlibs where the community shares, verifies, and validates that a particular lib works with a specific PB version? And after a good bit of users have validated the lib, it could be added to a "trusted" list of userlibs that are certified for use with PB versions. My biggest problem is organization followed by endless testing and checking for userlib functionality.

Re: Consistent method for PB Include and libs

Posted: Sun Sep 28, 2008 1:46 pm
by luis
localmotion34 wrote: My Biggest problem is that I have 2 workstations and a laptop that I program on where i synchronize my PB folders. When on my laptop, all the paths get waaay screwed up because of different drive letters.
I understand this is a personal solution only, but for my use I defined a #PBL_ROOT in a "luis.res" files, and all my sources are using

IncludeFile #PBL_ROOT + "/inc/file1.pbi"
IncludeFile #PBL_ROOT + "/inc/file2.pbi"
Import #PBL_ROOT + "/libs/lib.lib"

and so on

So I need to have only a different "luis.res" file for different installations, and the includes keep working.

Posted: Sun Sep 28, 2008 8:26 pm
by Rescator
?!

Code: Select all

Debug #PB_Compiler_Home+"Includes\"
Debug #PB_Compiler_Home+"Includes\Residents\"
Debug #PB_Compiler_Home+"Includes\Libs\"

Posted: Sun Sep 28, 2008 8:29 pm
by ts-soft
Rescator wrote:?!

Code: Select all

Debug #PB_Compiler_Home+"Includes"
Debug #PB_Compiler_Home+"Includes\Residents"
Debug #PB_Compiler_Home+"Includes\Libs"
I have used this, but on vista, i can't edit my includes without UAC :wink:

Posted: Sun Sep 28, 2008 8:49 pm
by Rescator
Consider that a "safety" feature for your precious includes,
until freak adds a "Include Directory:" under "Source Directory:" in the IDE Editor preferences ;)
(behavior of includes would not change except that if a include is not found then the IDE looks in the default include path as well)

Posted: Mon Sep 29, 2008 12:32 am
by JCV
Ive always used
Import #PB_Compiler_Home + "\Static Library\"
IncludeFile #PB_Compiler_Home + "\Include\"

Posted: Mon Sep 29, 2008 1:26 pm
by DoubleDutch
Rescator: Good idea - I'll use that. :D

ts-soft: If you right-click a directory in Program Files, you can set permissions to allow users to modify the contents - this will bypass UAC.

Posted: Tue Sep 30, 2008 6:30 am
by Mistrel
I use a file Prototypes.pb which includes all other project files with function declarations at the top. The benefit of this is that you will never have to worry about using a function that hasn't been declared because this is always done so before the includes.

Easy as pie. :)