Error message in Scipad // messageBox

François Vogel fvogelnew1 at free.fr
Fri Aug 29 22:24:03 CEST 2008


Hi Bruno,

Thanks for informing us about the reasons why you made this change 
(commit 27068). Now I understand your reasons.

So now TCL_Get/SetVar do lock the interpreter. OK, good to know.

Since I felt your initial commit had weaknesses, I have asked 
Sylvestre to discuss these with you. I think that most of my concerns 
are now properly addressed by your new version (commit 27103).

Namely:

   - you are now correctly using the Scipad localization mechanism 
instead of mixing Scilab and Scipad schemes

   - the function messagebox, which is not available before Scilab 5, 
is now only used with Scilab 5.

   - you are now correctly taking into account the possibility that 
the user wants to turn off the message box. This was a request from 
the newsgroup:
http://groups.google.com/group/comp.soft-sys.math.scilab/browse_thread/thread/5114c502b986bbf0/
that I had implemented in Scipad 6.127
FYI, the switch allowing to control this is in the "Options" menu from 
Scipad, item is named "Execution errors".

   - you seem to correctly escape certain special characters

   - I have also checked that the fix for bug 3037 (lasterror can 
produce multiline error messages) has not been broken


Basically your code now leaves untouched what will be run under Scilab 
4.x environments, and this is very correct. Code for Scilab 5 
environment is correct as well I think.

Therefore, many thanks for fixing commit 27068 based on my comments. 
Good job!


Francois


Bruno JOFRET said on 29/08/2008 15:43:
> Hi there,
> 
> Yesterday I made a commit changing scilaberror proc and make it use 
> messageBox new Scilab function.
> Some explications among that :
> 
> There is no need, I guess to show again the locking process that can 
> happened using TCL and Scilab.
> We did some efforts making TCL_EvalStr work within a TCL_EvalFile and it 
> seems to be ok.
> BUT for what concerns direct access to the TCL interp (through 
> TCL_GetVar/SetVar) it shows out some troubles if the interpreter is not 
> locked.
> 
> Try to change TCL_Getvar using requestTclInterp instead of 
> getTclInterp/release.
> Then do some stupid script like this one :
> ---
> while (%t)
>   before_tcl = rand(10,10);
>   TCL_SetVar('myvar', before_tcl);
>   after_tcl = TCL_GetVar('myvar');
>   if (or(before_tcl - evstr(after_tcl) < 1e-9) == %F) then pause, end
> end
> ---
> 
> You will see the TCL Lib blowing up.
> 
> So we locked back TCL_GetVar/SetVar that make scilab hang when try to 
> display what lasterror() was returning.
> Type "error(10)" in scipad then load it.
> 
> The solution to fix that bug was to let Scilab display the error box, 
> that's why we used "messageBox".
> 
> I just updated a new version of this proc using :
> - scipad localisation process
> - scilab5 global value to not break double compatibility
> - ScilabErrorMessageBox flag to desactivate the box, I guess, but I was 
> unable to find where I can do this :-$ Shames on me.
> 
> I guess this answer the request you made to Sylvester, but if you have 
> some other let me know.
> 
> I will also update a little bit the wiki with some graphs explaining the 
>  threaded process we have.
> 
> Regards,
> 



More information about the dev mailing list