>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement