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 1-4: Command Line Switches

  Switch  
IDL Workbench
(idlde)
Command Line
(idl)
Windows
Virtual Machine
(idlrt)
UNIX
Windows

-32

-arg

-args

-batch

-data

-demo

-e

-em

-minimized

-nl

-novm

-pref

-queue

-quiet

-rt

-ulicense

-vm

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.

Opening a File from the Command Line

The IDL Workbench will automatically open a file in an editor if you provide the file name as an argument. The syntax is:

idlde ["]file_to_open["] 

Although quotation marks are optional, they ensure an unambiguous result on all Windows platforms.

Batch Mode

IDL can also be started in non-interactive batch mode by specifying the name of a batch file at startup time.

The syntax for running the IDL Workbench (idlde) and command-line IDL (idl) in batch mode is:

idl batch_file 
 

or

idlde -batch batch_file

Note
When starting IDL in batch mode, batch_file should be located on the IDL path, or it should be a fully-qualified pathname.

Command-Line Switches

The following command line switches can be used when invoking IDL. Unless otherwise noted, switches can be combined and 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.

-arg

Syntax: -arg value

Specifies a single command line option to be passed for subsequent access via the COMMAND_LINE_ARGS function. The value is saved as a string. 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 passed for subsequent access via the COMMAND_LINE_ARGS function. When IDL sees the -args option, it takes any command-line arguments that follow it and passes them all as a string array. 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.

-batch

Syntax: -batch

Specifies a file to be executed in non-interactive "batch" mode.

-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 IDL Workbench, 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.

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 (Application Programming) for details on creating applications with an embedded IDL license.

-minimized

Syntax: -minimized

Forces the IDL Workbench to start minimized.

-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, its default behavior is to load the application in Virtual Machine mode. Setting the -novm switch prevents the application from running in Virtual Machine mode, and instead causes it to run in demo mode.

This switch has no effect on the UNIX or Windows IDL Workbench.

-pref

Syntax: -pref=file

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

Note
If a relative path specification is provided for file, the path is relative to the directory from which IDL is started.

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 hard-coded in 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.

This switch is supported for Windows idlrt.exe, but it has no effect.

-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 (Application Programming) for details on creating runtime applications.

This switch is accepted by the idlrt.exe application on Microsoft Windows platforms, but it is redundant.

-ulicense

Syntax: -ulicense

Checks out a unique license even if IDL is already running on the same host and user account. 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 (Application Programming) for details on creating applications that run in the IDL Virtual Machine.

Eclipse Command Line Flags

The following flags are native to Eclipse and are accepted by IDL at the command line:

-data

Syntax: -data path

Selects a different workspace, located in path.

-nl

Syntax: -nl locale

Selects a different locale (language). Locale is a two-letter ISO language code, such as en (English), es (Spanish), de (German), fr (French), it (Italian), or ja (Japanese).

Eclipse and the IDL Workbench are both internationalized, but do not share the same language list. If a language is chosen that both platforms do not support, there will be translation mismatches in the UI (Eclipse portions of the UI will be documented in one language, and IDL Workbench portions documented in another).

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), PREFERENCE 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 at the command line. See IDL System Preferences (IDL Reference Guide) 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 after the name of the IDL executable you are using. For example, to start IDL in Virtual Machine mode using the -vm switch, use the following command:

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.

As another example, use the following command to start the IDL Workbench in quiet mode:

C:\IDL_DIR\idlde\idlde.exe -quiet 

Again, IDL_DIR is the directory where you have installed IDL.

If you launch IDL by double-clicking on the application icon, set the switches by following this procedure:

  1. Right-click the IDL application icon, and select Properties.
  2. The IDL Properties dialog displays.

  3. On the Shortcut tab, add the switches after the executable path in the Target box.