View Full Version : Common Code
Richard
10-30-2006, 05:21 PM
Having a library of "common code", I tried to put this in a separate folder as I did not want to maintain a copy of the same code for each project.
Unfortunately, when I include it in my project, PPL shows the current directry in the project list (and not the folder I opened it from). It then copies the code to the project library.
As PPL does not identify other code with the folder name, I assume this is a, (how shall we say,) a minor flaw in PPL?
I hope this is the case, as the only other choice I have is to place my code in with all the PPL code like "swapi.ppl". Not nice.
Thanks.
kornalius
10-30-2006, 06:52 PM
Hi,
Please describe step-by-step what you did with folder names etc...
Richard
10-30-2006, 08:36 PM
Hi Kornalius,
Ok, I regret I cannot say exactly what I did, so I did another test.
I created a project "Test". This is appended to my PPL root folder, so the project file is saved in:
D:\PPL\Test
I then created a form and saved it in the same folder then added it to the project list.
So far, everythings fine.
I have a PPL file called "common.ppl" which is in
D:\PPL\Common
I added this to the project and the project list now contains:
common.ppl (D:\PPL\Test\n\)
test.frm
The directory D:\PPL\Test\n\ does not exist, but the project file has the same details thus:
--------------------------------------------
\My Documents\Convert\Test\,D:\PPL\Test\
\Program Files\PPL\,C:\Program Files\PPL\Runtime\
1,1
D:\PPL\Test\Test.frm
0
0
0
0
0
d:\ppl\common\common.ppl=\My Documents\Convert\Test\n\,D:\PPL\Test\n\
test.frm
------------------------------------
and yes, the pocket PC directory is:
\My Documents\Convert\
This is different to my other projects, where the path shown in brackets is that of the base project.
With a valid path, the common.ppl reappears in the selected folder.
The problem I have, is that I have several "common.ppl" files, but I only want one.
I think if the path in brackets (and obviously the project file) was correct, it would solve my problem.
By the way, yes I realise there is a common.ppl in the PPL runtime library, but fortunately PPL it is using the one I created.
Thanks, Richard.
kornalius
10-30-2006, 09:37 PM
Thanks we have found the problem and fixed it.
In the meantime you can right-click on Common.ppl and hit Clear Custom File Destination.
If you don't want common.ppl to be copied to your project's folder you will need to set a new project destination.
Richard
11-04-2006, 07:21 PM
Humm, I must admit your "fix" is not very user friendly ~:(
Since 1.07, the "Add file to project" just copies the file to the current project folder. At least before it looked as if PPL files could be in a different folder.
So I am asking for a change :!
Could we please have the ability to have code that is common to several projects in a different folder? Similar to the "Runtime/lib" folder, but for users?
I'd be happy with it as a fixed folder like those shown in the "Project Options" dialog. Or even a fixed folder name within the project folder.
But obiously allowing us to specify the folder in the "Add file to project" would be the best solution - providing it reads from that folder and does NOT copy it to every project!
The fact that in 1.06, the folder name was shown in the project list would indicate this was how it should have worked, even if it didn't.
So Please :)
Otherwise I will have serious problems with the same PPL file in multiple folders, all with different ammendments etc. etc.
So far, I only have five projects, but even now I'm finding this a problem.
(As far as the PPC folders as concerned, then I'd be happy for the common code to go into the project folder. But then I don't often use my PPC for programming.)
Thanks,
Richard.
PointOfLight
11-04-2006, 11:11 PM
I agree. There should be some way to set a directory or set of directories as an "include" path, just like the Microsoft products do. In the mean time, Richard, you could put your common code in the %PPL Install Dir%\Runtime\Lib directory. Then when you do an #include, it will automatically find it. This way you don't even have to add it to the project. If you want to edit it, just right click on the #include line and select "Open selected file".
Richard
11-05-2006, 11:17 AM
Yes indeed, I had thought of using Lib, but I wanted to keep it totally separate from the distributed code - just in case...
That and I'd never remember to back it up.
Thanks for your support and the tip on right clicking on an include, that's neat.
Despite the number of posts, I am very happy with PPL. It is easy to use and the support is fantastic. Considering I've only been using PPL for about three weeks, I am amazed at what I have achieved so far.
kornalius
11-05-2006, 03:41 PM
I believe there is a way in PPL to set include paths. I will have to look through the code, I don't remember how I did it.
As for including files from other folders, it is not as easy as it sounds. PPL will need to re-create the folder structure on the target device. I will look into it to fix it.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.