I have some code which calls InString within a nested loop.
Psuedocode looks something like:



while not Done,
fetch a line of text from textfile
break if we failed to read a line of text
for each string in stringarray,
if string is a substring of textline
do something
endif
endfor
endwhile


InString is crashing after several iterations... any ideas?
(If I comment out the InString compare, everything is groovy - also, I have no registers that I don't mind clobbering aside from ebp/esp, so whats going on?)
Posted on 2004-11-30 21:58:13 by Homer
I have just replaced it with Hutch's InStringx variant procedure.
The problem is gone - I can only assume InString either messes up the stack or clobbers the stack pointer...

Was InString replaced in any recent version of the masm lib?
Posted on 2004-11-30 22:19:32 by Homer
EvilHomer2K, the code you have posted looks well. Post your code to let us see if we can help you.

Some comment to find where the problem is:

- Check what happend if Done==TRUE at the end of loop
- InString is a 1 based character index, so check what do you do to create the line of text (example: replacing CRLF with NULL may be cause an error).
- Check what happend with flags and values while comparing ocurre.

I am trying to imagine some common errors, and if I post every thing that can be causing the problem, I will be writing for ever, so please, post the code.
Posted on 2004-11-30 22:42:27 by Kecol
Scratch this post, I made a simple addressing error.
Posted on 2004-12-01 05:35:07 by Homer