View Single Post

  #5 (permalink)  
Old 11-17-2005
Winwaed's Avatar
Winwaed Winwaed is offline
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 850
Blog Entries: 7
Wilfried has a good overall idea. If it fits what you're doing, it will be the fastest option.

If you must use this code, there are three things you can try:

- Simplify your comparisons. Can you work with numbers for the first 2 chars?
If you use numbers, you can use a Look Up Table.

- Are some options more likely than others?
List them in order of likelihood. The most likely first. This removes many unnecessary comparisons.
Also investigate a binary search instead of a linear one.

- Use the VB6 "With...End" statement. This avoids a lot of VB's member lookup processing time.


Richard
__________________
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009
Reply With Quote