Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing values to another form.
Message
De
22/07/1998 03:47:33
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
21/07/1998 13:46:32
Brad Stickley
Parker Pneumatic Div. North America
Wake Forest, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00119709
Message ID:
00120049
Vues:
19
>>>>>I have form that has a text box bound to a table. I need to pass the value in the text box to another form. How do I do that and what would the code look like?
>>>>>
>>>>>Thanks, Brad.
>>>>
>>>>If you are creating the new form, then it's not such a problem
>>>>
>>>>Use
>>>>
>>>>DO FORM formname WITH THISFORM.Textbox.Value
>>>>or
>>>>loForm = CreateObject( "formclass", THISFORM.Textbox.Value)
>>>>
>>>>and then pick up the passed value by using a PARAMETERS statement in the Init of the Form.
>>>
>>>Mark,
>>>
>>>Thanks for responding to my question. What should the init code on the form look like with the parameters?
>>>
>>>I am using on the main form DO FORM c:\b3\magnify.scx with thisform.text1.value
>>>
>>>I put LPARAMETER cString in the init of the second form. Does it automatically asign the passed variable to the parameter?
>>>
>>>Thanks again,
>>>Brad.
>>I think Mark is not here so I can answer. Yes Brad cString would be assigned the value you passed. But beware that parameter(s) are scoped to init method. You either save it in a form property or use just in init. ie: if you use it in something like :
>>
set filter to myField = cString
You would face an error message. Instead use "name" clause of form I suggest.
>>
do form myCaller name ("myForm") linked
>>*From within myCaller any method
>>DO FORM c:\b3\magnify.scx
>>* Now magnify.scx could access myCaller's text1.value via myForm
>>* or any PEM of myCaller
>>* Magnify.scx any method, event
>>if myForm.text1.value = ...
>>....
>>* Or change a prop in myCaller
>>myForm.text1.backcolor = rgb(255,255,128)
>>*Or refresh myCaller
>>myForm.refresh
Cetin
>
>Thank you very much for answering my quesions.
>
>I am getting an error "NO Parameter Statement is found" however, I have put Lparameter cText1 in the init of the new form. Any suggestions?
>
>Thanks in advance,
>Brad
Brad,
Possibilities I can think :
-lparameters (or parameters) is not the first line in init.
-Windowtype property is 2 or 3 (only FP 2.x converted could be) so parameter is passed to load event not init.

But in all I still insist using "name" clause in "do form" is better. You'll realize it's, when you try to return value(s) from a form or need to access another form.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform