Re: How to find the unfindable bug?
"How the heck" - yes indeed. How the heck can we give any ideas when you give us no information except that you have copy and pasted some code.
Since that is all we have to go on, I will guess that you fail at copy & paste. A possible alternative is that you have some path handling that doesn't make sense from one place but does in the other.
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
Bookmarks