|
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 |