Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Include file
Message
De
05/10/2007 01:55:52
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
04/10/2007 16:18:07
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01258255
Message ID:
01258807
Vues:
14
>We talked about this outside the UT box, but I'm glad you posted it here as well. Thanks for your help and I do undertand now, though I still wonder about the why of it. If I can declare a variable in MyMain.prg and have it in scope any place below that, why can't the same be done for constants? I would expect that if I put the INCLUDE call in MyMain program, it would know what it is later down the road, rather than having to make the call again, and again...

Jay,
you see that a #include / #define will be valid to the compiler after it's mentioned in the code.
You do not call an #include. The compiled code will have no sign of # statements left. If you have access to refox you might play with it.

A #define may be placed somewhere in your code. The #include statement (remember: it's not an command!) states to the compiler: "Handle the list of #defines found in the file(s) as they where written right here". So the compiler will read the #defines into it's list and check further words against it.

Now why can't it be used the way of an variable?

Because you have no meaningfull way tho change the order of compilation. The project will be compiled file be file. If this is bound to file types or the order the files are listed in the pjx I have no idea.
After the compilation the are linked together to build the exe file.

An exe file OTOH is not much more then a container keeping the single parts (prg vcx frx ...), a loader to the runtime dlls, a handler for the entry point of your main.

All the stuff you do within an exe should work without an exe. Even without pjx. Do you remember the days of dBase if there was nothing like an exe? VFP still gives you all that. The goal of the exe file is that we not need to urge our customers to buy a copy of VFP. (This was a failure. MS simply sells not enough copies)

You may put all parts of the exe in a directory branch, set up SET PROCEDURE, SET PATH, SET CLASSLIB (this is something the exe does at startup internally) and run your main from the IDE.
Each single is compiled to its own, at its own time. So from where should the compiler know compiling programm A what #defines are mentioned in the main? The compiler has now idea that prog A is somehow linked to main.

HTH
Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform