Darwinbots Forum

Code center => Bugs and fixes => Solved Bugs => Topic started by: Testlund on October 27, 2005, 12:36:07 PM

Title: Run-time error 13 in 2.37.4
Post by: Testlund on October 27, 2005, 12:36:07 PM
While running a simulation I clicked on the icon for 'Starting new simulation' to enter the GUI. I just remembered it's a bug I've reported about before. I think the crash is caused if I have changed the mutation to anything higher than 1/1 on the mutations tab.

The code (located in the Optionsform window at line 764:

MutLab.Caption = (TmpOpts.MutCurrMult) + " X"

Hovering info:

Mutlab.Caption = "32X" (yeah, it was set at 32X now, but it doesn't matter if it is set at 2X or 8X for example)

Tmp.Opts.MutCurrMult = 32

This is where I should post this, right?
Title: Run-time error 13 in 2.37.4
Post by: Ulciscor on October 27, 2005, 12:38:26 PM
Yep right place  :D

Surely you want the concat operator to form the string for the caption? Isn't it

Code: [Select]
&and not

Code: [Select]
+?
Title: Run-time error 13 in 2.37.4
Post by: Testlund on October 27, 2005, 12:41:09 PM
Umm... You mean I should change the + to & instead?
Title: Run-time error 13 in 2.37.4
Post by: Ulciscor on October 27, 2005, 12:44:11 PM
I s'pose you could try it. I'm nowhere near as good as [Num] [PY] or [Bots] though so you might want to take advice from them not me  :P
Title: Run-time error 13 in 2.37.4
Post by: Testlund on October 27, 2005, 12:48:40 PM
I guess you are right! No crashing anymore!  :boing: Let's just hope it doesn't affect how the mutation function work or anything.  :)
Title: Run-time error 13 in 2.37.4
Post by: PurpleYouko on October 27, 2005, 12:50:45 PM
In VB it is quite acceptable to directly add strings together using the + operator

It is in fact about two orders of magnitude faster than using &
Title: Run-time error 13 in 2.37.4
Post by: PurpleYouko on October 27, 2005, 01:06:26 PM
OK I just deliberately reproduced this bug in a running sim.

Anyone can do this by the following method.
This used to work fine so my belief is that the Cstr function was accidentally deleted at some point. This is reinforced by the fact that there are already brackets around the offending numerical value.
Title: Run-time error 13 in 2.37.4
Post by: Testlund on October 27, 2005, 01:20:12 PM
That worked too.  :)