X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 15 Jul 2005 02:12 PM by  anon
#ifdef for IDL prgramming
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
15 Jul 2005 02:12 PM
    I have a program that I would like to complile under IDL 5.2 and 6.1. If it is being compiled under 6.1 I would like it to compile certain code and if compiled under 5.2 a different block of code would be compiled. In C++ this can be done with "#ifdef" Is there something similar to this in IDL? thanks!

    Deleted User



    New Member


    Posts:
    New Member


    --
    15 Jul 2005 02:12 PM
    After 4 months, I would've expected someone to reply to this by now. But the answer is no, there's no direct equivalent. A test of the !version.release system variable will get you part way to the functionality you desire, but this is an execution time rather than a compile time test. An option is to have a larger build/compilation script that would update the contents of an include file depending on the version that would be included during the compilation of your application. For example, your source may have Pro MyApp @version_specific End You may have two source include files residing in the same directory, each with its version-specific code to be executed. version_specific_v56.pro: Print, 'version 56' version_specific_v60.pro: Print, 'version 60' And a build script that would look something like Pro build case !version.release of '5.6' : specific = 'version_specific_v56.pro' '6.1' : specific = 'version_specific_v60.pro' endcase file_copy, specific, 'version_specific.pro', /overwrite resolve_routine, 'myapp' ... end Before executing MyApp, you would execute build.pro to ensure the appropriate functionality is present.
    You are not authorized to post a reply.