Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing a variable between forms
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00495803
Message ID:
00495818
Views:
15
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform