Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timer capability outside form
Message
De
19/08/2004 16:41:00
 
 
À
07/08/2004 11:08:53
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00931480
Message ID:
00934648
Vues:
27
>>>Althought that will probably work, it really isn't necessary to add it to a form, or screen.
>>>
>>>
>>>Public MyTimer
>>>MyTimer = CreateObject("cMyTimer")
>>>
>>>
>>>should also work.
>>>
>>
>>No need for public, private is fine...Jim Booth would throw a fit :)
>
>Yeah, I know; any variable defined as private in the main program is public, for all practical purposes. Personally, I don't like using public variables either.
>
>I am just thinking of the following. What would happen if I define a Timer with a local variable, in the main program? What would happen with the object? In any other place (outside the main program), the variable is invisible, but still exists. Would the Timer events run? Not that I am proposing such a radical thing, but I was just wondering what would happen.

Declaring it PRIVATE would have no effect (it's essentially PUBLIC to all code that is called from the main routine). What would happen is that your timer object would go out of scope when the main reoutiine was finished, which is probably what you'd like to have happen anyways.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform