Valhalla Legends Forums Archive | Visual Basic Programming | Which is Faster?

AuthorMessageTime
Imperceptus
Which is faster?
[code]sqlCommand = Mid(sqlCommand, 1, Len(sqlCommand) - 2) & ")"[/code]
or
[code]sqlCommand = Left(sqlCommand, Len(sqlCommand) - 2) & ")"[/code]
October 20, 2004, 7:38 PM
UserLoser.
Never looked into it, but probably Left().  Mid() requires has more parameters, and has to check the start position, while Left() will always use the first character as the start position
October 20, 2004, 11:13 PM
Grok
Use Left$ instead of Left, Mid$ instead of Mid, and + instead of &, since you know for a fact you are working with strings, VB can remove all the extra crap for variants.
October 21, 2004, 12:34 AM

Search