Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How not to use value in .h file
Message
De
08/07/2010 12:08:23
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01471862
Message ID:
01471866
Vues:
44
>Hi,
>
>I ran into an issue with control name conflicting with the entry in the include (.h) file. For example, say I have in my .h file the following:
>
>#define SOMESTRING 25
>
>Then I have a control that is named SOMESTRING. Then, when I compile the program and the code that uses the control name is changing to 25. Obviously compiler gives error message. I will have to be careful in naming controls such that it does not conflict with include file. But meantime, is it possible to tell the compiler (in a certain place in the code) that such as such "string" should not be preprocessed?

You might use #UNDEFINE. But in general, I think it is better to avoid such situations in the first place - don't globally #DEFINE a constant if you will have this kind of exceptions.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform