Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro Substitution with THIS.Property
Message
 
 
À
21/07/2000 11:37:37
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:
00395115
Message ID:
00395495
Vues:
12
Hi Cindy,

I didn't want to offend you or Barbara by this code. The temptation just was so strong and besides, one of my colleague uses macro expansion all the times, even in this syntax:
use &thetable.
It just irritates me, because it theory this syntax would not work, if thetable contains spaces (not our case, though).

Anyway, the point is that it's not necessary to use macro substitution, if there are other ways...


>Nadya,
>
>Please note ">>Here's some code from Barbara Peisch's txtSearch class:"
>
>This is Barbara's code, not what I did with the code when I "re-arranged" it to my liking.
>
>Sometimes code like this has been in use for several versions without being revised to take new features into account. Not everyone uses the latest version. Some code is written in the most clear and obvious way for easy reading rather than fast or efficient execution. Not everyone has time to go back and re-work old code that works. Barbara may or may not drop in here to explain herself, and she may not feel that she needs to.
>
>I do know that some MVP's were glad to have the blue envelopes removed so people were not always after them to be "perfect" since they were the so-called experts. I don't know whether Barbara was in this category.
>
>I worked on one project in the past where the stated goal was that a beginning programmer was to be able to maintain it. I could think of thousands of ways to "improve" it but that was not the goal I was told to operate under. Needless to say I didn't want to stay there long because that project did little to develop my skills.
>
>

>
>>>>How can I use the & macro sub command using a value of THIS.Property....the macro stops processing when it encounters the period after THIS.....Thanks in advance....
>>>
>>>Peter,
>>>
>>>Here's some code from Barbara Peisch's txtSearch class:
>>>
>>>lGrid = THIS.grdName
>>>
>>>THISFORM.LOCKSCREEN = .T.
>>>IF NOT EMPTY(THIS.grdName)
>>> THIS.PARENT.&lGrid..SETFOCUS() && Extra dot ends the & expression
>>>

>>
>>
>>Hi Cindy,
>>
>>Don't tempt me please :)
>>
>>lGrid = THIS.grdName
>>
>>THISFORM.LOCKSCREEN = .T.
>>IF NOT EMPTY(lGrid)
>>   local lObject
>>   lObject=evaluate('THIS.PARENT.'+lGrid)
>>   lObject.SetFocus()
>>
>>
>>
>>
>>
>>> THIS.PARENT.&lGrid..SETFOCUS() && Extra dot ends the & expression
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform