Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Chaining commands
Message
De
29/01/2008 12:24:26
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
29/01/2008 11:55:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01286728
Message ID:
01286754
Vues:
23
>This is probably a dumb question but . . . in VFP is there a way to chain multiple commands on a single line? Something like:
>
>x=4|y=6|x=14
>
>I've never seen this form but several other languages allow it.

No, since ENTER is the end-of-command marker.

But often there are shortcuts, which you may also use to make code more compact (and unreadable).

Here is one:
if x
  Function1()
endif

* may be wirten in a single line as follows:
iif(x, Function1(), "")
I sometimes used it when there are many similar groups of commands: if option1 is selected run report1, if option2 is selected run report 2, etc. - but it must be used with care, since the result can be difficult to read. Just as when you chain commands as you were hoping to achieve.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform