Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use an oApp object
Message
De
24/01/2001 09:05:46
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00467798
Message ID:
00467825
Vues:
8
Gerard,

The THISFORM syntax can only be used within a form and automatically refers to the form the object is contained in.

When you get to your oApp you're not on a form any more. If you want oApp to know which form to validate you will want to pass in the values of the control(s) you are validating.

Use something in the Save button like
LOCAL lcParm1, lcParm2, lcParm3

lcParm1 = THISFORM.txtName.Value
lcParm2 = THISFORM.txtAddress.Value
lcParm3 = THISFORM.txtCity.Value

oApp.ValidateForm(lcParm1, lcParm2, lcParm3)
>Nuno, thanks for your reply.
>
>I dont follow what you suggest.
>I have an Application Object ,based on a a Container class, which has a number of Methods, one of which is to Validate fields from my form.
>So within the Validate Method of my Oapp class, I want to refer to fields on the form:
>What is the correct way to do this:
>oApp.ThisForm.Myfield or
>This.Myfiled or
>thisForm.MyField ....
>
>I am just confused as to how to refer to the form properties from within my application class.
>
>Regards,
>
>Gerard
>
>
>
>
>
>
>>Gerald
>> That is the BaseClass of the compoment ?
>>
>> Try Setting
>> This.Myproperty = 'Abc' .....
>> or
>> This.Parent.Myproperty = 'Abc' .....
>>
>> The error that gives you is because the primary object of the class is not a Form ( maybe a Container / Custom ...).
>>
>>Nuno Brito
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform