Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replacement for USE/SELE table with IF...ELSE...ENDIF
Message
De
02/10/2007 11:09:44
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
02/10/2007 11:03:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01257862
Message ID:
01257922
Vues:
25
>>>>>>I know there is some way of putting this on one line using IIF (I think), but I just can't recall it right now. Thanks!
>>>>>>
>>>>>>
>>>>>>IF NOT USED('Schedule')
>>>>>>	USE Schedule IN 0
>>>>>>ENDIF
>>>>>SELECT Schedule
>>>>>>
>>>>
>>>>Ok, I thought there was a one-line way of doing it, but maybe not.
>>>
>>>Is this what you are looking for?
>>>
Use schedule in select('schedule')
>>>NB! Will not work if you use other aliases than the name of the table.
>>
>>This differs from the original because it reopens the table is the either a new workarea or in the same workarea it is currently open. If don't care about this, then it is a slick method.
>
>This is all very well, and they all exhibit degrees of slickness, but I wonder what the point is.
>
>So you get a line of code that's so slick the beholder has to ponder it, maybe even try it out, before appreciating what it does, then is taken aback by how clever the author is.
>
>But that very fact is its weakness. And what has been gained other than the obviation of one or two lines of code, especially at the price of clarity?
>
>And I wonder why Jay was so keen in getting this.

Because I had one line that did this and want it back again. I see your point, but in this case I can't imagine any code worth their pay could not see it fairly easily.


>
>My two-penn'orth.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform