11 March 2016 - Forum Rules

Main Menu

Help with some debugging

Started by pelador, August 02, 2022, 04:16:37 PM

Previous topic - Next topic


I'm onto the debugging stage of a randomiser I'm building for Breath of Fire on the Snes but I got this error.

Basically what it's supposed to do is operate a checkbox for selecting a flag to randomise. In my case just items at the moment. Now I could just remove the checkbox but eventually I'm going to want to add different options so I may as well include it now.

Does anybody have a solution?

Yes I acknoweledge that I'm a raw novice.   


I think your flags.Substring is currently null or 0 length. That's why it fails to get the first symbol from it for your conversion.


Doesn't matter what I change my substring to. I either get that error or I get Start index cannot be longer than the length of string.


You can see down in the watchlist (lower-left pane) that flags, and likewise txtFlags.Text, are "" i.e. a 0-length string. Looking at the documentation on String.Substring(Int32,Int32), ArgumentOutOfRangeException is expected here because you are calling it with startIndex + length = 0 + 1 = 1, which is greater than the string length of 0.

I can't quite tell what your code is trying to do, but I think this is a related issue: if chkTreasures.Checked is True, you append ConvertIntToChar(361) to txtFlags.Text; but ConvertIntToChar(361) just returns an empty string.


This bug's fixed. It was because I put the wrong string somewhere else. I was probably tired and wasn't thinking straight.

Anyway I still have another issue. Despite no more errors and the program able to make a seed, it does not randomise anything. I'm obviously missing something.