Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HowTo: Multi-line Comments in VFP (Take 2)
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
HowTo: Multi-line Comments in VFP (Take 2)
Divers
Thread ID:
00439900
Message ID:
00439900
Vues:
4848
Let's try again...

Visual C++ allows multi-line comments using this syntax:
/* This is a
multi-line comment
in Visual C++. */
Unfortunately VFP makes us mark each line as a comment, but you can simulate the Visual C++ style by flipping the leading /* to */ and adding a semi-colon to the end of each line, like this:
*/ This is a ;
multi-line comment ;
in Visual FoxPro. */
The syntax coloring will be off because the editor does not recognize this as a single comment, but it works and you won't get any errors.

This trick relies on a long-standing behavior of VFP that a comment line that ends with a semi-colon makes a comment out of the next line, too. This can be a "gotcha" sometimes, but works to our advantage here. Of course, the trailing */ is not required but can be added for the sake of completeness. And because it relies on the leading * to make a comment out of the first line, it cannot be used for inline comments.
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform