gdl icon indicating copy to clipboard operation
gdl copied to clipboard

.out does not go out of procedure if last command before "end" is "return"

Open brandy125 opened this issue 1 year ago • 1 comments

This simple program is just to simulate the problem that ".out" does not go out of a procedure if the last command is "return"

bash$ gdl
  GDL - GNU Data Language, Version v1.0.6-16-gc154de16
GDL> doit
% Compiled module: DOIT.
% Stop encountered: DOIT                 3 /home/chris/doit.pro
GDL> .out
5
GDL> help
% At DOIT                 4 /home/chris/doit.pro
     $MAIN$          
pro doit
stop
print,'5'
return
end

brandy125 avatar Jul 18 '24 19:07 brandy125

This comes from GDL 'optimizing out' the return. Without return in the PRO, or if 'doit' was a FUNCTION

function doit
stop
print,'5'
return,12
end

All would be OK.

But, indeed, there is no possibility to '.out' as the .out is blocked on line 4 . This is a bug.

GillesDuvert avatar Apr 27 '25 15:04 GillesDuvert