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 23:11:33
 
 
À
02/10/2007 09:02:36
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
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:
01258132
Vues:
10
Hi Jay.

Actually there is a way to do this in one line, but I'd never do it :-)

The Exact one line replacement for that code is -

ExecScript(Iif(Used("Schedule"), "Use Schedule in 0", "Select Schedule"))

If you would rather always be on the table when you are done, rather than only when it's already open, which seems likely, you can use -

ExecScript(Iif(Used("Schedule"), "", "Use Schedule in 0"+ Chr(13)) +"Select Schedule")

Of course, you're much better off doing it with a simple function call. It would take less typing, be easier to read, less error prone and you can add additional parameters as you need them to handle things like aliases, orders etc.

Ian Simcock.



>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 !USED('Schedule')
>	USE Schedule IN 0
>ELSE
>	SELECT Schedule
>ENDIF
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform