String Subscript out of range

I've been debugging this program since yesterday and I continue to run into a string subscript error. I pasted the code in a pastebin (it's only 400 lines), to see if anyone can figure out in their editor why I'm getting this. The problem seems to come up during a debug assertion failure.

http://pastebin.com/b1L8FG4s

Thank you.
My debugger says the problem is on line 224, so it's not an assertion failure.
It's literally what it says. A subscript out-of-range run time error means that you're attempting to access a non-existent array element.
Strange, all I get is an assertion failure on line 429:
fieldToString() returns
+3.X.\nXX.X.\n27.X.\n._.X.\n6..X.\n....+\n

vs
+3.X.\nXX.X.\n.72X.\n._.X*\n6..X.\n....+\n


Edit: added line no.
Last edited on
Yeah, but I already put in an error check for assessing any non existent array elements. I've been trying to fix this problem since last night and nothing solved so far.
I dunno man. If you like, I can help you rewrite it. Though I'd need strict guidelines on what exactly it is what you're doing. As far as I can tell, your program is supposed to simulate hive mind behaviour in ants - they collect food and bring it back to the mound.
Last edited on
No, it's okay. I can figure it out from here.
Topic archived. No new replies allowed.