• Welcome to Valhalla Legends Archive.
 

Which is Faster?

Started by Imperceptus, October 20, 2004, 02:38 PM

Previous topic - Next topic

Imperceptus

Which is faster?
sqlCommand = Mid(sqlCommand, 1, Len(sqlCommand) - 2) & ")"
or
sqlCommand = Left(sqlCommand, Len(sqlCommand) - 2) & ")"
Quote from: Hazard on August 07, 2003, 03:15 PM
Highlight your entire code. Press the delete key. Start over again using Cuphead's CSB tutorial and work your way from their rather than raping code from downloaded sources meant purely for learning purposes. If this does not fix the problem, uninstall Visual Basic and get a new hobby. I suggest Cricket.

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

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.