Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#453 Issues with execute()

closed-out-of-date
nobody
None
5
2013-05-25
2012-01-18
Philip Rooney
No

I have used execute to dynamically create variables in a pipeline. The variables however are "forgotten" not long after, often in the same program.

A work around this is just to use the variable in any capacity just after creation, e.g. print, variable. Then it knows about them later on.

This isn't a problem in IDL so probably needs to be fixed at somepoint.

Discussion

  • Thanks for reporting it, but please provide us with an example code to reproduce this problem.
    Regards,
    Sylwester

     
  • Philip Rooney
    Philip Rooney
    2012-01-18

    Hi I am just trying to nail where the problem comes from exactly. I dont want to put up the pipeline I am working with and am currently stuck slightly for time. I have found this discrepency which may well be a related problem (but cannot be the same one as it never creates any variables at all). It concerns the creation of variables in a loop using execute:

    Type the following into IDL and GDL:

    for i = 1,6 do begin x='here'+strtrim(string(i),2)+'=3' & go=execute(x)

    After using "help" in IDL I get:

    GO INT = 1
    HERE1 INT = 3
    HERE2 INT = 3
    HERE3 INT = 3
    HERE4 INT = 3
    HERE5 INT = 3
    HERE6 INT = 3
    I INT = 7
    X STRING = 'here6=3'

    In GDL the loop doesn't work and it returns:

    % Parser syntax error: unexpected end of file

    Cheers

    Philip

     
  • Alain C.
    Alain C.
    2012-02-08

    I think the problem is not related to EXECUTE() but to a missing "endfor" in the loop

    for i = 1,6 do begin x='here'+strtrim(string(i),2)+'=3' & go=execute(x)& endfor

    is OK

     
  • Philip Rooney
    Philip Rooney
    2012-02-08

    Hi guys, I believe that it is a bigger problem than a missing endfor. The code that I actually used in my pipeline is in while - endwhile and for - endfor format. I will try and gather the input data and the actual code that is used so you can see what I mean. I am a little busy at the moment but will come back to it within the next few days. Cheers

     
  • giloo
    giloo
    2013-05-25

    ticket too old - bug likely to have disappeared.

     
  • giloo
    giloo
    2013-05-25

    • status: open --> closed-out-of-date