Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Yoda coding styles
Message
De
24/04/2006 08:49:06
Mike Yearwood
Toronto, Ontario, Canada
 
 
À
24/04/2006 00:33:19
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01115355
Message ID:
01115938
Vues:
13
Hi Dragan

>
>Actually I did have a few of these myself - like when I have a long string concatenation, to put the + sign into the beginning of the next line, or the AND in a long where clause. But this Claudio's extension of that philosophy actually knocked me off - it's so simple and beautiful. I have a few situations where I have similar lists in a couple of places, like this:
>
>
if used("mycursor")
>   insert into mycursor (fld1, fld2, fld3);
>   select g1, g2;
>      ,   g3;
>   from (lcOtherCursor)
>else
>   select g1, g2;
>      ,   g3;
>   from (lcOtherCursor);
>   into cursor mycursor readwrite nofilter
>endif
>
>After a few iterations, it's obvious I'll probably have more fields. With this comma-first way of it, I can just copy and paste lines. Adding the fourth field, or changing the order of fields, is a snap. Same goes for pretty much any other command which may have a list of fields. I just love this. I even don't have a problem that I wasn't the inventor :).

I think it's a toss-up. If you put the commas at the end, you can still move the lines around easily except for the last one.
select ;
  field1, ;
  field2, ;
  field 3 ;
If you put the commas at the front, you can move the lines around easily except for the first one.
select ;
  field 1 ;
  , field2 ;
  , field3 ;
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform