Hi,
Back on the CATCH procedure I encounter some problem with a very simple algorithm The following code:
PRO Continue_On_Error
I = SHIFT(INDGEN(10), -5)
F = INTARR(9)
FLAG=0
; Cause an error when K eq 4:
FOR K=0,10 DO BEGIN
CATCH, Error_Status
IF Error_status NE 0 AND FLAG EQ 0 THEN BEGIN
PRINT, 'In the Catch Loop'
K=K+1
FLAG=1
CATCH, /CANCEL
ENDIF
F[I[K]]=K
PRINT, K, I[K]
ENDFOR
END
Outputs the following log:
% Compiled module: CONTINUE_ON_ERROR.
% Compiled module: CONTINUE_ON_ERROR.
0 5
1 6
2 7
3 8
In the Catch Loop
5 0
6 1
7 2
8 3
9 4
After that, IDL prompt kept busy for ages and I need to kill IDL if I want to be able to work with it ! I don't understand why this is happening ?
Any idea ?
Best Regards.
Antoine C.
|