Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exiting class from a method
Message
De
21/07/1997 01:11:26
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordanie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00040790
Message ID:
00040870
Vues:
31
>>>>My class's click event is calling one custon method, which is checking the important properties (whethere set properly or not).
>>>>
>>>>If any of the 4-5 properties is not set properly then it should exit from class, the problem is if I give a return statement from custom method, it returns control to click method..
>>>>
>>>>Any suggestion..
>>>>
>>>>Actually, I will prefer to do something like this..
>>>>
>>>>If !allok &&calling custom method & returning logical value
>>>>
>>>>return
>>>>endif
>>>>
>>>>Thanks in advance..
>>>
>>>
>>>Try adding something like this in the Click() event...
>>>
>>>RETURN CustomClass.Method() AND Expression1 AND Expression2
>>
>>Thanks for your reply but Speaking frankly, this went above my head...
>>
>>Actually I am very new to class(s), Can you pls explain me what exactly I should write..
>
>
>Firstly, you want the click(0 event to Return a True or False. True if everything is OK and checks are performed sucessfully.
>
>Next, You have a custom class which has a method, say CheckAll(), which does the checking you require for properties and returns a True or False. True if all checks are successful.
>
>*-- Button.Click()
>IF CustomClass.CheckAll()
> Return .T.
>ENDIF
>
>OR
>
>RETURN CustomClass.CheckAll()
>
>If you want to ckeck some other expressions or property in your button which should also be checked before returning the value from Click() of button you could have
>
>RETURN CustomClass.CheckAll() AND MyForm.lProperty AND MyExpression
>
>Here when all three are true then only your click will return a True

cool stuff...

Now its clear, Thanks... I will try it...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform