Dreaded OutofBoundsException

Is there an easy way to track down the source of an “OutofBoundsException was not handled” error? I decided to make improvements on a program I wrote and now that error is being thrown when it is opened as a standalone, not when run from Xojo itself. What are some of the common causes?

Thanks for the advice!

The most common cause is a difference in file access / paths. If you have any hard-coded paths or if you are opening anything in the same folder as the application (no path), then check those first. Use System.DebugLog to print out information, or just a few “I am here” messages, and make note of where the messages stopped. That will help you narrow it down.

Found the issue. I was saving directly to Program Files (x86) which is a no-no. Where should I save preference data to?

specialfolder.applicationdata is a good place to start you should create a folder for your app and save any preferences in that folder.

If you have more than one app (or ever will), create a folder for your company, with a folder for each app inside.