Previous IDL Interface Guide: Introducing IDL Next

Command Line Options for IDL Startup

You can alter some IDL behaviors by supplying command-line switches along with the command used to invoke IDL. The following table shows the IDL command-line switches and the IDL interfaces to which they apply:

Table 2-4: Command Line Switches

Table 2-4: Command Line Switches
  Switch  
UNIX
idl
idlde
Windows
idlde.exe
Windows
idlrt.exe
-32
·
   
·
·
·
·
·
·
·
   
·
·
·
-e
·
·
·
-em
·
 
·
·
·
·
-nw
·
   
·
·
·
·
·
·
·
·
·
-rt
·
·
·
·
·
·
·
·
-vm
·
·
-w
·
   

Preference Switches

In addition to the switches listed above, you can specify the value of IDL preferences when invoking IDL. See Specifying Preferences at the Command Line for details.

X Defaults

In addition to the switches listed above, there are numerous command-line switches that control the appearance of the IDL Development Environment on UNIX systems. Those options are not listed here, and future versions of the UNIX Development Environment might not continue to support them. See X Resources at the Command Line for details.

Batch Mode

IDL can also be started in non-interactive "batch" mode by specifying the name of a batch file at startup time. See Executing Batch Jobs in IDL for details.

Command-Line Switches

The following command line switches can be used when invoking IDL. Unless otherwise noted, switches can be combined and can be specified in any order.

-32

Syntax: -32

Starts IDL in 32-bit mode. If this switch is not set, IDL starts in 64-bit mode by default for those platforms that support 64-bit. If you have not installed the 64-bit version, the 32-bit version will automatically be started. If you have not installed the 32-bit version, this flag will not work.

This switch is only available on UNIX platforms.

-arg

Syntax: -arg value

Specifies a single command line option to be saved for later access via the COMMAND_LINE_ARGS function. The value string is saved. Multiple -arg switches are allowed; the values are saved in the order specified. The -arg option can be used to pass program-specific information from the command line to IDL programs.

-args

Syntax: -args value1 value2 ... valueN

Specifies one or more command line options to be saved for later access via the COMMAND_LINE_ARGS function. When IDL sees the -args option, it takes any command-line arguments that follow it and saves them all. There can only be one -args option on an IDL command line, and it is always the final option. The -args switch can be used with the -arg switch; if both switches are specified, occurrences of -arg must come first, and the values specified by -args are saved following any values specified by -arg.

-autow

Syntax: -autow

Starts IDL with the graphical user interface if possible. If for any reason IDL cannot display the graphical user interface, it starts in command-line mode.

This switch is only available on UNIX platforms.

-demo

Syntax: -demo

Forces IDL to run in seven-minute demo mode.

-e

Syntax: -e IDL_statement

Specifies a single IDL statement to be executed. Once the statement has executed, IDL waits for any widget applications to exit, and then IDL itself exits. Only the last -e switch on the command line is honored.


Note
If the IDL statement includes spaces, it must be enclosed in quote marks. Under UNIX the statement can be enclosed in either single or double quotes, but under Microsoft Windows the statement must be enclosed in double quotes.

Under UNIX, the -e switch always uses the command line interface (that is, the idlde command followed by the -e switch behaves like the idl command followed by the -e switch).

Under Microsoft Windows, the idlde command displays the full development environment, but the user is not prompted for IDL commands to execute. This mode is primarily useful because the output log window is visible, and will show any output generated by the IDL statement. The idlrt command also supports the -e option, and in this mode requires a standard IDL license. Since idlrt does not display the output generated by IDL statements, it is primarily of use for widget based applications that provide a graphical user interface to their functionality.


Note
Because the -e switch causes IDL to exit as soon as the statement is complete, if the IDL statement being executed produces graphics, you may wish to delay the exit until the user has a chance to view the graphics. In such a case, you must explicitly cause IDL to wait before exiting. For example, the following will produce a plot of one cycle of a sinusoid:

idlde -e "PLOT, SIN(FINDGEN(628)/100) & t=DIALOG_MESSAGE('Done')"

The plot will remain on the screen until the user dismisses the dialog, at which point IDL will exit.

-em

Syntax: -em=file

Starts IDL with an embedded license. The file argument should be an IDL .sav file that contains an embedded ("unlimited right to distribute") IDL license. See Distributing Runtime Mode Applications for details on creating applications with an embedded IDL license.

This switch is accepted on UNIX platforms and by the idlrt.exe application on Microsoft Windows platforms.

-novm

Syntax: -novm

Forces IDL to run in seven-minute demo mode rather than Virtual Machine mode if no license is available. This switch can only be used in conjunction with the -rt switch or the idlrt.exe executable.

If IDL attempts to load and run an IDL application in runtime mode, but finds no license available, it will load the application in Virtual Machine mode by default. Setting the -novm switch prevents the application from running in Virtual Machine mode, and instead causes it to run in demo mode.

-nw

Syntax: -nw

Starts IDL in command-line mode no matter what. Note that specifying idlde -nw at the shell prompt will start IDL in command-line mode.

This switch is only available on UNIX platforms.

-pref

Syntax: -pref=file

Loads the specified preference file. The file argument should be a text file containing IDL preference/value pairs. See IDL Preferences for a detailed description of IDL's preferences system, the format of preference files, and the precedence given to different sources for preference values.

This feature is of particular interest to those writing stand-alone applications in IDL, possibly using the runtime or Virtual Machine modes of operation. The use of a command-line preference file allows authors of such applications to control the values of preferences important to their applications in a way that is user-adjustable and not hardwired into the code of their application.

-queue

Syntax: -queue

Causes IDL to wait for a license to become available before beginning an IDL task such as batch processing. This switch is useful for users of counted floating licenses who need their IDL process to run in licensed mode rather than in seven-minute demo mode.

-quiet

Syntax: -quiet

Suppresses printing of the IDL announcement and the motd.txt file. See Message of the Day Files for details on message-of-the-day files.

-rt

Syntax: -rt=file

Starts IDL with a runtime license. If the file argument is specified, it should be an IDL .sav file. If the file argument is not specified, IDL attempts to run a file named runtime.sav. See Distributing Runtime Mode Applications for details on creating runtime applications.

This switch is accepted on UNIX platforms and by the idlrt.exe application on Microsoft Windows platforms. It is, however, redundant when using the idlrt.exe application.

-student

Syntax: -student

Forces IDL to start in student mode. This switch is useful for testing IDL applications that should run in student mode.

-ulicense

Syntax: -ulicense

Check out a unique license even if IDL is already running on the same display. If IDL has checked out a unique license using this flag, the user is allowed to change the DISPLAY environment variable after IDL has started.

-vm

Syntax: -vm=file

Starts the IDL Virtual Machine. If the file argument is specified, it should be an IDL .sav file. If the file argument is not specified, IDL displays a file selection dialog. See Distributing Virtual Machine Applications for details on creating applications that run in the IDL Virtual Machine.

This switch is accepted on UNIX platforms and by the idlrt.exe application on Microsoft Windows platforms.

-w

Syntax: -w

Starts IDL with the graphical user interface. This is the same as entering idlde at the command prompt.

This switch is only available on UNIX platforms.

Specifying Preferences at the Command Line

In addition to the command line switches described above, the value of any IDL preference can be specified at the command line using the following syntax:

idlcommand -PREFERENCE value  

where idlcommand is the command used to launch IDL (one of idl, idlde, or idlrt), PREFERNCE is the name of an IDL preference (note the leading hyphen), and value is the value for the preference. For example, to set the value of the IDL_MORE preference to one when launching IDL in command-line mode on a UNIX machine, you would use the following command line:

idl -IDL_MORE 1  

Any number of preference values can be specified the command line. See IDL Preferences for a detailed description of IDL's preferences system and the precedence given to different sources for preference values.

Using Switches Under Windows

Under Microsoft Windows, applications can be launched either from the prompt in a Command Window or by double-clicking on the application icon. If you launch IDL from a command prompt, simply specify the switch on after the name of the IDL executable you are using. For example, to start IDL in Virtual Machine mode using the -vm switch, you would use the following command line:

C:\IDL_DIR\bin\bin.platform\idlrt.exe -vm=file.sav  

where IDL_DIR is the directory where you have installed IDL, platform is the platform-specific bin directory, and file.sav is the name of the SAVE file you wish to restore and run.

If you launch IDL by double-clicking on the application icon, set switches by modifying the target specified in the application's shortcut properties to include the switch.

  IDL Online Help (March 06, 2007)