Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Constants
Message
De
19/08/1996 06:12:47
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00005998
Message ID:
00006085
Vues:
67
>>Does anyone know how to keep a constant active within a form? I use the
>>#Define Myvar x at the beginning of my program, then try to compare it
>>to a value when a control is pressed on a form (specifically the up/down
>>click events on a spinner). VFP tells me MyVar can not be found? A
>>work around I have found is to #Define MyVar again in the Init of the
>>form but I would like to avoid this. Any hints?
>
>AFAIK, VFP #defines are like C/C++ #defines in that they can't really have a 'global scope', unless you put it in some 'include file' that gets included in each of your forms' code. This is basically what you're doing now, but it sounds more hip. =)

yep VFP #define and #include are just like C/C++ ones

and indeed u have to #include again for every form u want to use

when u design a form u can chose from the form menu "include file"
and specify the .h fiel u want, if you make this part of your base form class
it will be included automatically in all your forms
btw, even if u don't use forms as classes u can still make this the default
behaviour by making a subclass form and use it as a template form (settable under options)

Arnon
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform