Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameter Passing in Forms
Message
From
14/10/1998 03:17:32
 
 
To
14/10/1998 03:08:32
Jocylyn Sy
Freelance Programmer
Cebu, Philippines
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00146521
Message ID:
00146524
Views:
21
You can use the following convention to call your second form:

do form frm1Name NAME frm1Test

where frm1Name is the name of the second form and frm1Test is a variable. Now, from the second form you can reference ANY objects on the first by using

frm1Test.

in the same way as per usual. So to change the caption property of the first form, from the second form, you could say

frm1Test.caption = 'Hello'

Alternatively you could invoke the second form by using the following line

do form frm1Name with lnAccount, ldDate to lnTemp1, ldTemp2

where lnAccount is the account number, ldDate is a date, and lnTemp1 and ldTemp2 are variables used to store the result. In the INIT event of the second form use the parameter statement to receive this data. Remember, in the INIT event of the second form, the data that you pass is only accessible by this method, so you need to move the data to another variable. Then, in the unload event of the second form, simply return the data. So:

1)On the click method of button on first form

do form frm1Name with lnAccount, ldDate to lnTemp1, ldTemp2

2)On the INIT methodt of the second form

parameter lnParam1, ldParam2

thisform.lnAccount = lnParam1
thisform.ldDate = ldParam2

3)On the UNLOAD method of the second form

return thisform.lnAccount, ldDate

This should return the values back to the first form.

I hope this was of some use

Derek
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform