X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 25 Jun 2008 02:34 PM by  anon
How to create a variable with its name passed by at runtime without using execute()?
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
25 Jun 2008 02:34 PM
    I know execute() can create variables with their names passed by at run time. For example, com = 'variable1' + " = '" + '55' + "'" & tmp = Execute(com) will create a varialbe 'variable1' with value equals to 55. Since Execute() is not supported in IDL Virtual Machine, is there any way to do it without using Execute()?

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    25 Jun 2008 02:34 PM
    It is mentioned in the IDL help for execute that the routines 'CALL_FUNCTION, CALL_METHOD, and CALL_PROCEDURE' do not share this limitation and in many cases, can be used to replace calls to EXECUTE for VM distributions.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    25 Jun 2008 02:34 PM
    I do not think this is possible without using EXECUTE. However, in my experience it is almost always possible to do what you want to do without having to create a variable name on the fly. Perhaps if you explained why you want to do this I could suggest an alternative solution.
    You are not authorized to post a reply.