Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drag Drop - Resize
Message
 
To
19/02/2004 15:25:58
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00878808
Message ID:
00878923
Views:
16
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
Previous
Reply
Map
View

Click here to load this message in the networking platform