Report your bugs here.
2 posts • Page 1 of 1
I have written a DLL which I'm using in 20Sim. I thought simulation should not start if Initialize returned 0, so just for fun I let the Initialize return 0. When I press start, the simulation runs, I do not get feedback that there are errors in the initiale phase. Then I tried to return 1 from "myFunction" (normally returns 0 if successful), and the simulation stops and the Message Log shows: Error occured in user dll-function "myFunction". This should also happen when Initialize returns 0.
You are right. The return type of the initialize function is not checked. It will be fixed in the new build of 20-sim. The return value of 0 will be interpreted as succes, just as the "normal" functions. Another return value will be interpreted as error. The idea behind this method was that different return values could indicate different kind of errors. Unfortunately we never expanded this functionality to make a list of error codes. But for backward compatibility reasons it is difficult to change this definition.
member 20-sim development team