#496 Error in 'if' structure : no line number

closed-fixed
nobody
None
5
2012-11-12
2012-10-24
Kalith
No

The error message "Subscript out of range" sometimes does not show any line number along with the procedure name in which it was triggered.
Here is a simple example that produces the error :

;do_something.pro
;-----------------------
pro do_something
a=intarr(2)
if a(4) eq 1 then print, "foo" else print, "bar"
; Note that :
print, a(4) ; shows the line number correctly
end
;-----------------------

GDL> do_something
% Compiled module: DO_SOMETHING.
% DO_SOMETHING: Scalar subscript out of range [>].5
% Execution halted at: DO_SOMETHING /local/home/kalith/gdl_libs/do_something.pro
% $MAIN$

Discussion

  • Kalith

    Kalith - 2012-10-24

    Forgot to mention : as in my other bug report, I am using the CVS version of GDL from 10/17/2012.

     
  • Kalith

    Kalith - 2012-10-24

    I even think any error that occurs witin an 'if' structure (in the condition or the body) does not get a proper line number :

    ; Example 2
    pro do_something
    a=intarr(2)
    if 1 then b=a(4)
    end
    ; Prints :
    % Compiled module: DO_SOMETHING.
    % DO_SOMETHING: Scalar subscript out of range [>].5
    % Execution halted at: DO_SOMETHING /local/home/cschreib/Programmation/idl/do_something.pro
    % $MAIN$

    ; Example 3
    pro do_something, flag=flag
    a=replicate({value:1}, 5)
    if a.sub(2) eq 5 then print,"foo"
    end
    ; Prints :
    % Compiled module: DO_SOMETHING.
    % DO_SOMETHING: Tag name: SUB is undefined for STRUCT.
    % Execution halted at: DO_SOMETHING /local/home/cschreib/Programmation/idl/do_something.pro
    % $MAIN$

     
  • Kalith

    Kalith - 2012-10-24
    • summary: "Subscript out of range" : no line number --> Error in 'if' structure : no line number
     
  • Marc Schellens

    Marc Schellens - 2012-11-12
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks