Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drag Drop - Resize
Message
 
À
19/02/2004 15:25:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00878808
Message ID:
00878923
Vues:
17
I maintain a superstition that if/else executes faster. Besides, with if/else constructs, we can embed arguments that apple to any conditionls reamianing in the list:
lSomething=.t.
if x=1
   * Do something with lsomething
else
lsomething=.f.
if x=2
   do something with lsomething
else
if x=3
   do something2 with lsomething
else
   lsomething=.null.
endif
endif
endif
I did test in DOS xBase once. IF/ELSE executed in half the time of IF/ENDIF!

>Terry!
>
>Why not to use DO CASE here?
>
>...
>DO CASE
>CASE nKeyCode=56 AND .height>1 &&Up
>      .Height=.Height-1
>CASE nKeyCode=50 &&Down
>      .Height=.height+1
>CASE nKeyCode=54 &&Right
>      .width=.width+1
>CASE nKeyCode=52 AND .width>1 &&Left
>      .width=.width-1
>ENDCASE
>...
>
Imagination is more important than knowledge
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform