Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code Standards
Message
De
01/10/2003 14:41:17
 
 
À
01/10/2003 13:31:07
Information générale
Forum:
Visual FoxPro
Catégorie:
COMCodebook
Titre:
Divers
Thread ID:
00832733
Message ID:
00833924
Vues:
22
>And as for:
>
>"This is line 1." + ccCRLF ;
>   + "This is line 2."
>
>In this case, we are stricter than most. We STRONGLY adhere to placing the '+' at the beginning of the additional line as in the example above so you can easily tell that the 2nd line is a continuation of the previous line. That to us is much more readable.

I agree with this format, too, but for another reason. When you need to remove a condition from a list of conditions, you can remove the line cleanly. The only time you need to edit the previous line is if it's the last one that's being remove. Same applies for AND/OR situations.
IF x=0 ;
   AND y=1 ;
   AND z=2
ENDIF
easily becomes
IF x=0 ;
   AND z=2
ENDIF
And ALWAYS include a trailing space before the ";" at the end of a line! Can prevent syntactically incorrect statements especially in SQL, like:
SELECT field1;
FROM sometable;
INTO CURSOR test
SELECT field1 ;
       FROM sometable;
       INTO CURSOR test
I also try to indent continuations lines to a more logical (to me) position after the first keyword of the statement, like the above or:
SomeVar = "Part1" ;
          + "Part2" ;
          + "Part3"
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform