Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you pass parameters to a METHOD from a FORM?
Message
De
31/01/2001 10:17:03
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00470601
Message ID:
00470623
Vues:
45
---
ok, I see... METHODS work the same as functions..OK - great..good to know
nothing has changed...thanks for your help ...:)))

>Simple
>
>RetVal=THISFORM.MyMethod(param1,param2)
>
>Bob
>>>Sorry should be
>>>THISFORM.MyMethod(param1,param2)
>>>
>>>Also, why not include your code right inside the VALID
>>>
>>>THISFORM.my.myfld.VISIBLE = THISFORM.myfld.VISIBLE
>>>
>>>HTH but I don't see exaclty what you are trying to achieve??
>>>
>>>Bob
>>>
>>>>>To pass a parameter to a method:
>>>>>
>>>>>THISFORM.MyForm(param1,param2)
>>>>>
>>>>>and in the method include a LPARAMETER statement
>>>>>
>>>>>Bob
>>>>>
>>>>>>I have a method called mymethod() and in the VALID event of my form, I want to called Mymethod() and pass THISFORM.MYFLD.VISIBLE = MYVAR –
>>>>>>Mymethod with look like this –
>>>>>>* MYVAR = false or ture
>>>>>>If myvar = .t.
>>>>>> Thisform.my.myfld.visible = .t.
>>>>>>else
>>>>>>Thisform.my.myfld.visible = .f.
>>>>>>endif
>>>>>>
>>>>>>I am use to calling functions with args.
>>>>>>but calling methods from a FORM are different - any ideas?
>>>>---
>>>>hi Bob...
>>>>By "THISFORM.MyForm(param1,param2)" do you mean -
>>>>THISFORM.Mymethod(param1,param2)?
>>-----------
>>Hi Bob...
>>That was just a sample and not a very good one, but I just wanted to know how to call a METHOD and pass parameters. I can see it is the same as calling FUNCTIONS. You helped me with that part, now what about if I want to have the METHOD return a value? ...example
>>MYMETHOD parm1
>>local amt
>>do something...
>>return amt
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform