Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I add some code to multiple methods
Message
De
14/10/2003 10:59:34
 
 
À
14/10/2003 10:36:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00838523
Message ID:
00838549
Vues:
24
Hi Glenn,

Yes, I espouse multiple exits when useful, that's true. I wouldn't, though, call any such construct a "premature exit" because:
1) when it's appropriate to exit, it cannot be 'premature';
2) executing to the end of any procedure does not constitute "maturity".

However, the real point of this reply is to ask you why you think that the problem posed here would require special handling if the routine did have multiple exits as opposed to a single exit BUT with a few llReturn=.F.s sprinkled through it?

cheers

>You need to set the flag at the beginning of the method code because there may be a pre-mature code exit ( as supported by Jim Nelson ) like this
>
>if some condition
>  return
>endif
>code
>code
>code
>if some other condition
>  return
>endif
>code
>code
>return
>
>
>
>>>I have a VFP 8 multiple page pageframe that contains about 100 text boxes. I want to stick in a line of code, "m_fieldmodified=.T.", in the interactivechange event of each text box. Many of the text boxes already have text in the interactive change event. Is there a quick way of doing this?
>>>
>>>Thanks,
>>>
>>>Vim
>>
>>This method works best for each individual page.
>>
>>Edit the page in the pageframe.
>>Select all the checkboxes you want to change.
>>Run the following code.
>>
ASelObj(laCheck)
>>For Each loCheck in laCheck
>>  lcCode=loCheck.ReadMethod("InteractiveChange")
>>  lcCode=lcCode+Chr(13)+"m_fieldmodified=.T."
>>  loCheck.WriteMethod("InteractiveChange", lcCode)
>>Next
>>You may need to modify this code to put the line at the appropriate place, but it should get you started.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform