X
3447

How to determine whether or not an IDL program is running in the IDL Virtual Machine

The IDL Virtual Machine™ (IDL VM™) is a free runtime utility that allows developers to distribute compiled IDL applications without licensing requirements or fees. 

With the introduction of the IDL Virtual Machine with IDL 6.0, IDL developers may have a need to programmatically determine whether a program is running in the Virtual Machine or in licensed mode. This Help Article discusses how this can be done.


Discussion

The LMGR function and the /VM keyword can be used in cases where there is a need to determine if an IDL program (.sav file) is running in the IDL Virtual Machine as opposed to licensed mode.

One example of when this may be useful is with a program that use the EXECUTE routine which is not supported in VM mode. In this case the program could first check the license mode and notify the user when appropriate. The following line of code shows how this can be done:

IF LMGR(/VM) THEN void=DIALOG_MESSAGE('You need an IDL license to access this functionality', /ERROR)

In some cases it may be useful to disable certain parts of an application if it is being run in the IDL Virtual Machine. Here is an example of how to disable a button or menu option based on license mode:

b=WIDGET_BUTTON(tlb, VALUE='Compute Result', SENSITIVE=~LMGR(/VM))

This code will cause the "Compute Result" button to be grayed out if the program is run with the IDL Virtual Machine.

Also, the following Help Article #4633 has directions following installation of the IDL virtual machine as well.