[scilab-Users] Fw: SCILAB hangs when used in try-catch
Julio Gonzalez-Saenz
julio.gonzalez at ymail.com
Mon Apr 19 19:40:39 CEST 2010
Hi Bruno,
Yes.. I know, this is exactly I wanted to do.. to check the correct behavior in my try-catch method..
I need an error so that try block is not executed but catch-block. And this type of error is the easiest one..
Regards,
Julio
________________________________
From: Bruno JOFRET <bruno.jofret at scilab.org>
To: users at lists.scilab.org
Sent: Mon, 19 April, 2010 17:22:55
Subject: Re: [scilab-Users] Fw: SCILAB hangs when used in try-catch
hi,
You have an error in that line
if (x < 2) then t = x +"sr";
You try to make an addition between a double and a string.
This is not allowed in scilab so it will try to call an overload method.
try this :
if (x < 2) then t = string(x) +"sr";
And this should no more have any failure.
Regards,
Julio Gonzalez-Saenz wrote:
>
> Hi SCILAB community,
>
> !Scilab Version: !5.2.0.1266391513 ! !
> !Operating System: !Windows 7 6.1 ! !
> !Java version : !1.6.0_18 ! !
> !Java runtime information : !Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
> ! !
> !Java vm information : !Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode)
> ! !
> !Vendor specification: !Sun Microsystems Inc.
>
> I have a problem running a try-catch-end block when a while loop in inside it.
>
> For example, the following code just create magic matrices from 4 to 1 but at x=2, an error supposed to happen. The error is correctly detected, but I have to restart scilab because it does not respond..
>
> x=5;
> try
> while (x>=0)
> x=x-1
> disp("x sollte positiv sein")
> if (x < 2) then t = x +"sr";
> else z=testmatrix("magic",x)
> end
> end
> catch
> x
> disp('catch: Ein Fehler ist aufgetreten');
> z=testmatrix("magic",10)
> end
>
> I can not find the reason of this failure in the mailing list... maybe someone know something about it??
>
> Regards,
>
> Julio Gonzalez-Saenz
> www.part-time-scientist.com
> www.neex-technologies.com
>
>
-- Bruno JOFRET
Software Architect
The Scilab Consortium
Digiteo Foundation
Domaine de Voluceau
Rocquencourt - B.P. 105
78153 Le Chesnay France
Phone: +33.1.39.63.58.63
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20100419/451d1255/attachment.htm>
More information about the users
mailing list