Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compile time directives
Message
 
 
À
30/05/2002 18:49:52
Joe Stanton
Brave New Software, Llc
Visalia, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00663230
Message ID:
00663238
Vues:
15
Hi Joe,
Welcome to UT!

The compile-time constants are visible only in the PRG file they are declared in. In your case 'INDEVELOPMENT' constant is only visible in the main program. You've to include them into every PRG file that references them. Usually they are put into header file with .H extension and that file is included in the programs using #INCLUDE Preprocessor Directive or in forms/classes using Include File menu option.


>Greetings - This is my first post here. All help is appreciated. Joe
>
>---------------
>
>I am trying to structure some code that I can stop development and cut a new APP foir my client without my new stuff messing him up. To do so I want to use compile time directives.
>
>In the main module I place this line:
>
>#DEFINE INDEVELOPMENT 1
>
>Within this module there are locations where I reference this like so:
>
>#IF INDEVELOPMENT = 1
>...do something new and special
>#ENDIF
>
>or even tried this:
>
>#IFDEF INDEVELOPMENT
>...do something new and special
>#ENDIF
>
>In several other modules (some of which are PRG's the others are SCX's) I do the same thing.
>
>The compiler issues no errors for the coding, however I do remember (when using #IF rather than #IFDEF) getting the "Preprocessor expression is invalid" when editing.
>I suspect scope is the issue at hand here but can find absolutely no documentation on scope for compile time variables.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform