Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Coding, syntax & commands
Title:
Always better to ...?
Hi All!
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>...
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only