Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing params (correct content)
Message
De
11/03/1998 03:14:29
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00081635
Message ID:
00083807
Vues:
31
>>Snip...
>>>Hello Again,
>>>
>>> I found my problem. The forms in this case are based on a class contained in a vcx then turned into a project form using New/New Form and dropping the form class from the toolbar. Problem is, I forgot to remove the formset after removing the default form1 from the form designer. So, while reading about PARAMETERS, it makes the statement "It must be the first executable statement in the called object". Since it actually is a formset, the formB Init is not first,
>>>formsetB Init is first. Just another case of proceduralitis on my part.
>>>
>>>Thanks for the tip on passing the THISFORM reference.
>>>
>>>Eric Kleeman
>>Eric just another tip, you could pass thisform to pass a reference to FormB, but the reverse needs "name" clause.
>>
>>* Case 1
>>*formA
>>do form formB with thisform     && Just pass thisform ref to formB
>>...
>>* FormA is clicked or called from formB - formB still open
>>* Want to click or change a value in formB - there is no reference to formB
>>
>>* Case 2
>>*formA
>>do form formB with thisform  name "formBReferenced"  && Pass thisform ref to formB and also have a reference to formB
>>...
>>* FormA is clicked or called from formB - formB still open
>>formBReferenced.text3.value = "Newvalue"    && We have a ref to formB now
>>formBReferenced.cmdDummy.click
>>...
>>do form formC  && Another form is called
>>*FormC
>>formBReferenced.text3.value = "FormC changed this"  && Even another form has a ref to formB
>>
>>
>>Cetin
>
>Cetin,
>
>I am going to use your suggestion but just one more hangup,
>
>I am going to , DO FORM formB WITH THIS , from formA then from formB I need to set a property in formA. When I try to reference formA in KeyPress of formB.list1, it says it cannot find the referenced object. I recieve the reference via formB Init as a parameter paramB. Then , paramB.textbox.value = xxx , in formB.list1.KeyPress does not find the formA.textbox object.
>
>Can you explain this referencing further?
>
>Eric K.
Hi Eric,
* FormA calling
do form formB with thisform     && Method 1 - form reference passed as a parm

refFormA = thisform
do form formB                   && Method 2 - paramB object var created

* In method 2- formB any PEM could reference formA until refFormA is released
* No parameters in init for that
* formB.list1.KeyPress
refFormA.textbox.value = xxx

* In method 1 - thisform passed to init of formB as ref
* formB.init
parameters oFormCaller
* oFormCaller is local to init method. To make it visible to all form
* one thing you can do is to assign it to a custom form property
* Suppose formB has a custom prop. oCaller
this.oCaller = oFormCaller

* formB.list1.KeyPress
thisform.oCaller.textbox.value = xxx
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform