Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing a variable between forms
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00495803
Message ID:
00495818
Vues:
13
What I would do is put an ASSERT VARTYPE(lcThisTable) = "C" right after the LPARAMETER statement. In the command window, type SET ASSERTS ON. Run the first form. When the assert fires, click the Debug button. In the Call Stack window of the DEBUGGER, work you way backward through the call stack to try to trace where your code went wrong.

Personally, I prefer not to pass parameters to forms. I use an global application object that I can add properties to. For example, in your click of the button:
if not pemstatus(goApp, 'cTableAlias', 5)
   goApp.AddProperty('cTableAlias', '')
endif
goApp.cTableAlias = 'oldmastertable'
DO FORM ADJUSTMENTS

Now, in the Init of the second form:

if not pemstatus(This, 'cTableAlias', 5)
   This.AddProperty('cTableAlias', '')
endif
This.cTableAlias = alltrim(goApp.cTableAlias)
local lcAlias
lcAlias = This.cTableAlias
if not used(lcAlias)
   use (lcAlias) in 0
endif
select (lcAlias)
>Hello Everyone!!!!
>
>Simple question, How can I pass a variable from one form to another for instance:
>
>In the firt form's command button that calls the the second form I have something like this:
>
>    lcTable = 'oldmastertable'
>    DO FORM ADJUSTMENTS WITH lcTable
>
>in the second form's INIT method I have:
>
>     LPARAMETER lcThisTable
>     SELECT (lcThisTable)
>
>
>OF course lcTHIStable's value = .f.
>but it should not be
>
>Do you know what is wrong???
>Thanks in advance
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform