Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PUBLIC variables won't work when i call in the form
Message
De
15/01/2002 18:04:33
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
15/01/2002 12:28:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00604937
Message ID:
00605145
Vues:
22
>PUBLIC variables won't work when i call in the form. why is it that all the public variable that i declared in the main program will be missing in the form. here's my code.
>
>***Main.Prg
>PUBLIC oMyObject
>SET CLASSLIB TO myClass
>oMyObject = CreateObject("App")
>oMyObject.Init()
>DO FORM MyForm
>
>
>***MyForm.Scx
>
>*Init Method at myform.scx
>WAIT WINDOW oMyObject.MyText
>
>
>The oMyObject is missing when i run the program. is there anything wrong with my code or is there any setup in the VFP6 to activate the Public variable. please help me...

Take a look at READ EVENTS. main.prg won't pause at DO FORM (unless the form is modal), but continue. Probably you have a CLEAR ALL or CLOSE ALL later on.

Something like this:
* Setup goes here
oMyObject = CreateObject("App")
DO FORM MyForm
READ EVENTS && Program will remain here
* Cleanup:
CLEAR ALL

* And in the menu option, or form button, "Quit application":
CLEAR EVENTS
HTH, Hilmar.


HTH, Hilmar.
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