Code center > Solved Bugs
Run-time error 13 in 2.37.4
PurpleYouko:
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 &
PurpleYouko:
OK I just deliberately reproduced this bug in a running sim.
Anyone can do this by the following method.
* Go into the GUI in a running sim and moving the mutations slider off center (any value)
* click change to return to the simulation. Should run happily
* Go back to the GUI options menu and the program will crash with a "type mismatch" error
* Click Debug and it will take you to "DispSettings" in the "Optionsform" module. The highlighted line of code reads
--- Code: ---MutLab.Caption = (TmpOpts.MutCurrMult) + " X"
--- End code ---
* The reason for this error is that Mutlab.Caption has to be a text value, TmpOpts.MutCurrMult is a numerical value and " X" is text. You can't just add them
* Ulc's answer of substituting "&" for "+" seems to work to fix this
* My prefered fix is to turn the numerical value into a text then add them together like this.
--- Code: ---MutLab.Caption = CStr(TmpOpts.MutCurrMult) + " X"
--- End code ---
* Once fixed you can hit the "play" button on the VB toolbar and the program will continue from where it left off.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.
Testlund:
That worked too. :)
Navigation
[0] Message Index
[*] Previous page
Go to full version