Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code Standards
Message
De
02/10/2003 15:40:28
 
 
À
01/10/2003 20:06:01
Information générale
Forum:
Visual FoxPro
Catégorie:
COMCodebook
Titre:
Divers
Thread ID:
00832733
Message ID:
00834445
Vues:
35
>>>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.
>
>Huh? Isn't the same true when the + is at the end?! Like in...
>
*  Note that the text actually starts on the 2nd line.
>lcMsg = ;
>   "This is line 1." + ccCRLF + ;
>   "This is line 2." + ccCRLF + ;
>   "This is line 3." + ccCRLF + ;
>   "This is line 4."
>
>*  If I simply remove message line 3, I get ...
>lcMsg = ;
>   "This is line 1." + ccCRLF + ;
>   "This is line 2." + ccCRLF + ;
>   "This is line 4."
>
>*  It even works if I remove message line 1!
>lcMsg = ;
>   "This is line 2." + ccCRLF + ;
>   "This is line 3." + ccCRLF + ;
>   "This is line 4."
>
>

Could be, but that's my personal preference. ;)


>>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
>>
>In this case I agree. Although it's my strong opinion that the AND line should NOT be indented!
>
IF  x=0 ;
>AND y=1 ;
>AND z=2
>   WAIT WIND "kiekeboe"
>ENDIF
As far as indentation goes, I do not like to have any line that isn't the beginning of a statement at the same level as the beginning of the statement. Makes the code jump right out that it's a continuation or in some way block related.


>>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"
>>
>Agree. Although, under cisrcumstances, I prefer...
>
SomeVar = ;
>   "Part1" + ;
>   "Part2" + ;
>   "Part3"
I just prefer to have the complete first word of the statement stand out.
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