Print Page   |   Sign In   |   Register
RE: try - catch
Moderator(s):
Thread Score:
Page 1 of 1
Thread Actions

4/13/2012 at 11:34:06 AM GMT
Posts: 236
RE: try - catch
F. Blanchard said:

Hi.

 

I am trying to use try-catch function but when an error occurs the code between catch and end is not calculated.

So i tried to put on the errcatch function wihtout results.

Can anyone explain me why ?

 Here is tcode :

 errcatch(-1,"continue");

try
data=fscanfMat('MESURE-FB.TMP');
choix=data(data(:,1)==NumPiece,:);
catch
choix=[NumPiece,-1000,-1000];
end

errcatch(-1);

 

 

 

Thank you.

 

Frédéric

 

Hi.

You cannot use errcatch with try..catch.

I usually use pause for debugging.

To see what is wrong try:

try
   data=fscanfMat('MESURE-FB.TMP');
   choix=data(data(:,1)==NumPiece,:);
catch
    pause
    choix=[NumPiece,-1000,-1000];
end

Stanislav


Community Search
Sign In


Forgot your password?

Register Now!

Scilab Tips


Privacy Policy © 2014 Equalis LLC Terms of Use