Jump to content

Recommended Posts

Posted

I spent 20 - 25 minutes tracking down a small bug earlier. It was very very hard to spot. This one particular thing kept having a problem, even though other things passing through that same function were not. I was going nuts adding message boxes everywhere trying to track it down before I finally found and fixed it. It ended up being a combination of 2 things. First, I was incorrectly formatting the incoming data for all other instances except the one with the problem. The incorrectly formatted data produced my desired result. The other problem was a logic error on my part.

The moral of the story is, the bug is in your code and its likely a similar issue of having incorrectly formatted data producing either the correct result or the incorrect result. There are no issues with the File* functions which would cause this.

Take your input data and surrounded it by a unique (As in, not likely to appear in the data) character. I'm particularly fond of the following:

; Assume $data is your... data
MsgBox(4096, "Debug Trace", "|" & $data & "|")

This will show you any leading or trailing line breaks, spaces, or any other character that doesn't belong.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...