>I've encountered a tough problem. The section of code causing the >problem looks like the following: < SNIP > >Now you won't see any problem with this code fragment. My problem is >that when this code fragment is executed in my program it generates >25,30,0 instead of 25,0 unless the debugger is turned on. If the >debugger is turned on my program works fine. I display the variables >targetString$, searchString$ in my program just before executing and >I have confirmed that they have the values indicated. A tough one indeed, with no obvious cause, and the infuriating behaviour of working properly when you train a heavy debugging weapon upon it. Here are three approaches, not all of which may have occurred to you already. (1) The top probability is that the variables you mention don't actually have the values you expect, at the time of the bug. Have you considered printing them (and/or their LENgths) to a log file: open "O", 99, "logfile" // do this at program initialisation then write to the file each time just before the offending statement: print #99, "'"targetString$ "' '" searchString$ Inspection of the log could be enlightening. (2) Is the bug present in both PPC and 68K? The answer won't point to any particular cause, but it may limit the exuberance of hypotheses. (3) Is the heap OK at the time of the bug? It's easy to check, and very strange things happen if the heap is wrong. call DebugStr(";hc") Robert P.