: You already write better code then a lot of programmers I know...
: I took a second look at your original post, It looked like you have
: a huge string of combined values (I am making an assumption based on
: your variable name).
: How are you handling the case where two of those If Statements would
: be true. In a Select Case or the If Statements you and I both wrote,
: the first case that is met will be the only case that is executed...
: I figure you've already thought of this, but incase you haven't...
: happy coding :)
Well thanks for the compliment :)
Basically what this program does, at least this bit anyway, is read in one Datfile at a time... It's really only interested in the header... A process I still need to improve to speed up things... It then looks to see if that Datfile header contains one of 11 possible strings (I only showed a couple in my example)... If so then take appropriate action... I didn't originally want to do it this way but unfortunately the Datfile does not use a deliminator between the Manufacturer and System... They are however pretty much constant and should rarely change...
Anyway long story short there is no way for more one case statement, or if statement, to be true for any given Datfile...
Actually just had a thought to help make the program a bit more future proof... Remove those possible strings into a separate text file... Read it in line by line and create an array... say aryManufacturer... Then use a for...next loop to do the check... That way if the Datfiles change in the future, ie add or remove manufacterers, then only a text file change is required to make the program compatible again...
For Each v As String In aryManufacturer
If strCombined.IndexOf(v) <> -1 Then
strSearchName = aryManufacterer(v)
Sorry just thinking out loud :)
I actually have the program well enough for my own purposes... However it would be nice to make it flexible and robust enough to release to those who might need it...