Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to pass a variable value from form to .prg file
Message
De
28/12/2001 10:57:36
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
28/12/2001 03:45:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00598689
Message ID:
00598816
Vues:
18
>Hi all,
>
> can someone please tell me how to pass a variable value from a from to a .prg program. I know how to pass variable between .prg and .prg programs, pass variable between forms. but i cannot pass a variable value from a form to a .prg program.

This may not seem easy, but is more stable, and it's been tried and proven to work. You need a property in your form which will accept the value:
do form myform noshow name oForm
oForm.myproperty=myVar
oForm.show()     && or .show(1) for modal
If your form is modal, you can hide it instead of releasing it when you're done with it (i.e. user closes it), and the oForm variable will still hold a reference to it. You can retrieve the values of any properties of the form, even run any methods in it, before you issue oForm.release in your code.

If the form is not modal (or not shown as modal), your .prg will run from the oForm.show line and will not wait for the form to close or hide. The oForm variable will go out of scope - haven't tried this with modeless forms, so I don't know whether the form will stay in existence or not. If you instantiate it as ...name oForm linked, it surely will disappear when variable oForm goes out of scope.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform