Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Always better to ...?
Message
From
26/02/2000 13:50:52
 
 
To
26/02/2000 13:44:54
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00338054
Message ID:
00338056
Views:
25
There are a number of little tricks. Whil Hentzen is publishing a "tricks and techniques" book soon, check hentzenwerke.com for more information. One that I remember from way back is:

LOCATE (nothing after the command) is faster than GO TOP.


>I often wonder what is the most efficient way to code things. For instance, it seems that to alltrim(upper(fieldname)) must always be slower than upper(alltrim(fieldname)). I'm assuming in the first example, that the upper will operate on all characters in the field. In the second, upper will only act on the remaining characters. So, I always use the second method.
>
>How about this code...
>IF ! USED("sometable")
> SELECT 0
> USE sometable
>ELSE
> SELECT sometable
>ENDIF
>
>Wouldn't it ALWAYS be better to ...?
>
>IF ! USED("sometable")
> USE sometable in 0
>ENDIF
>SELECT sometable
>
>Now oddly enough, from speed trials I did, I'm not seeing much if any difference, and either piece of code may win the race, however, less typing means less mistakes.
>
>Anyone care to add other little bits of code? I mean, nothing more than 10 lines.
>
>Seems more appropriate than some other threads up here <s>...
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform