Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't see what changed
Message
De
10/07/2001 09:24:46
 
 
À
10/07/2001 08:39:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00527148
Message ID:
00528558
Vues:
24
>
>I remember spending over half a day on a problem in VFP5. It was as if the line hadn't been written. No warning, nothing. Thought and thought about it. Put in a space before the semi-colon just for grins and everything worked. Up until then I had never put in the space. One of my friends then told me about this oddity. Seems like this bug doesn't always bite. Just once in a while and that's enough.

I agree. I *always* put a space before the semicolon, but I use lots of whitespace anyway. Always one after a comma, around +, =, *, etc. It makes the code much more readable. I also do continuation lines differently than most VFP programmers. Here are a couple of examples:

Most of the code I've looked at does this:
MyVar = "Some really, really, really, " + ;
  "really, really long string"

IF ThisVar = SomeValue AND ;
  ThatVar = SomeOtherValue
I code it this way:
MyVar = "Some really, really, really, " ;
  + "really, really long string"

IF ThisVar = SomeValue ;
AND ThatVar = SomeOtherValue
The differences are subtle, but, IMO, my way is much easier to read. It makes it clear by looking at the beginning of the line that it is a continuation. You may not see it here, but try it my way in the middle of a program with many lines before and after. You'll see the difference.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform