Lots of problems with FF3 (mis-)Parsing my include files

Started by Theo Gottwald, May 21, 2010, 01:26:52 PM

Previous topic - Next topic

Theo Gottwald

Actually it looks to me, like FF3 doesn't know that it should not destroy Objects while parsing.
I have just sent pics to Paul, showing that some subroutines of within an Object are moved away and some not. For me without any reason. If this parser would just leave my object alone I'd really be fine!
I have just read, that it may help if i include these files myself with "#INCLUDE".
Does it mean, i have to always keep an updated Copy of these files in the "release folder" for compilation?
How do i include own modules/Objects without having FF3 touching and missparsing them in an acceptable way?
This is the most nasty thing i have found until now in FF3.

Besides that i like to use FF3, so i am looking for a good sollution from support or anybody here.

Brian Chirgwin

Theo,

You can include the full path
#include "C:\....\myfile.inc"

OR relative (to the release directory)
#include "..\..\appframework\myfile.inc". I have the directory like this:

\appframework
\source
    \forms
    ....
    \release

OR

Open Powerbasic and add the path as an include path under the compiler tab under Window, Options. If I remember correctly the code will automatically be found.


It is on my list to my shared library code a dll during development. This would make compilation quicker. My library is getting quit large and is a significant overhead on compilation time. For the final release I would compile the code into the exe avoid having to ship a dll.


Theo Gottwald

Thanks Brian,

Quote#include "..\..\appframework\myfile.inc". I have the directory like this:

This is just what i was looking for!
I think this way i can overcome the problem.
The only disadvantage will be, that the file will not be in the FF3 Workspace.

Theo Gottwald

#3
Its still not so easy. Now FF3 takes the #INCLUDE "...\" - lines itself and removes them from where they belong and places them into the "DECLARES.inc" file.

So far this would not be too bad. But it places them at a place before any Macros are defined!
Of course i get again a "Macro Phase Error".

For this Semi-Intelligent parsing, it seems that i have to rstructure my whole project and always think about "what will the parser make out of my code?".

This Semi-Intelligent Parser should be possibly switched off somewhere.
Do you have another Idea for me, how i can solve this problem without having to restructure my code in an unnatural way, because the parser will move it around by its own rules without my command for that?

--------------
Added: Ok, finally got it working, by removing all my include files out of the Firefly Workspace into an folder "Private" using the #INCLUDE "...\private" thing.

Brian Chirgwin

Theo,

Put all the includes in Special Functions FF_Appstart module. The are included in the order listed so you shouldn't have a problem.

I also have the following:

I have my "framework" of code, generic code that I use all projects I develop in a directory amazingly calls app framework. I don't have one copy shared for all projects, each project has its own copy. This allows me to modify it as necessary for a given project. I use subversion [svn] svn:externals to update all the code for all projects. If I have two projects A and B and I modify the framework in A, I commit the changes and can update B. I can also do it the other way as well as in both. SVN will alert me when there is a conflict which I need to take care of manually. I am looking at changing to mercurial (looks promising) from SVN. This gives me the best of both worlds. A shared library where all project get an update as well as not changing one project and causing a bug in another. Anyway a project directory structure is as follows:

My appframework has a lot of inc files as it is well structured. There is one "main.inc" which cotnains all the includes of the other files. This is the only one I require in my project. Well, there are a few others that are rarely used that I include on a case by case right now.

In addition I have an libs.inc This contains code that is conditionally added depending on "compile directives" %incEGRID, %incQuickPDF, %incSQLite, %incDoc, etc.. These are defined as %true or %false. (include or don't include).

One final piece is an appshell directory. This is a shell FF3 project that I copy to start a new project. I change the name, version info, etc.. but use this to start a new project. This has default menus, some common forms, etc...  In the FF_Startup are the %incQuickPDF = %TRUE (or %false) statement. Throughout the shell project certain functions will automatically be addded. For example, in the Main Form, the first thing that is done is to call libsInit this function contains all the initialization for any third party libraries such as QuickPDF, etc... In destroy I make sure libs are closed. This happens automatically now for projects.

When I am writing what will become a general function for my framework I have a module called mExperimental.inc. This module contains functions that, time permitting, or as needed get moved into the framework.

Well, probably more than you need to know.




David Kenny

Theo,

Brian was right about using the FF_Appstart module to put any includes in that you don't want to be parsed at all.  He just didn't say why.

Read Paul's post in this thread Started by Andy Flowes: http://www.planetsquires.com/protect/forum/index.php?topic=2360.msg18393#msg18393
(Small thread - it's only three posts long)

Granted, you problem and Andy's are different, but the solution is the same.

David