Actually finger v brain problems – the brain knows what I want to do but the fingers type something else.
In my defence I have been working in C# quite a lot and the mistake was in VB6 where the syntax is (quite) a bit different.
I was using ‘HRPEND’ as an end marker in a buffer filled at run time from a resource file and iterating through the buffer carrying out some action for each read until the current read contained the marker, so what did I do
If InStr(PartUnderTest, "HRPEND") <> 0
Do the work
For those non programmers out there the ‘InStr’ command returns the start position of the second string (group of characters), in this case ‘HRPEND’ in the first string and returns 0 if its not found. It doesn’t take a genus to work out that the work would only be done when HRPEND was actually found which is the total opposite of what I intended.
So I am putting this up here as a reminder to be more careful