Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

Input to IDL


Commands entered at the IDL prompt are usually interpreted as IDL statements to be executed. Other interpretations include executive commands that control execution and compilation of programs, shell commands, and so on. Input to the IDL prompt is interpreted according to the first character of the line, as shown in the following table.

Note
The information in this section applies equally to IDL used in command-line mode or via the IDL Development Environment.

First Character
Action
.
Executive command.
?
Help inquiry.
$
Command to be sent to operating system.
@
Batch file initiation.
or ¯ key
Recall / edit previous commands.
Ctrl+D
In UNIX command-line mode, exits IDL, closes all files, and returns to operating system.
Ctrl+Z
In UNIX command-line mode, suspends IDL.
All others
IDL statement.

Command Recall and Line Editing

By default, IDL saves the last 20 commands entered in a recall buffer. These command lines can be recalled, edited, and re-entered. The up-arrow key (   ) on the keypad recalls the previous command you entered to IDL, moving backward through the command history list. Pressing it again recalls the previous line, and so on. The down-arrow key ( ¯ ) on the keypad moves forward through the command history. When a command is recalled, it is displayed at the IDL prompt and can be edited and/or entered.

You can view the contents of the recall buffer in the following ways:

The line-editing abilities and the keys that activate them differ somewhat between the different operating systems.

Note
The behavior can also differ within the same operating system, between the Command prompt for IDL and the Command line on the IDLDE.

The table below lists the edit functions and the corresponding keys.

Function
UNIX
Windows
Move cursor to start of line
Ctrl+A or Home
Home
Move cursor to end of line
Ctrl+E or End
End
Move cursor left one character
Left arrow
Left arrow
Move cursor right one character
Right arrow
Right arrow
Move cursor left one word
Ctrl+B,
(R13 on Sun Keyboard)
Ctrl+left arrow
Move cursor right one word
Ctrl+F,
(R15 on Sun Keyboard)
Ctrl+right arrow
Delete from current to start of line
Ctrl+U
 
Delete from current to end of line
Ctrl+K
 
Delete entire line
 
 
Delete current character
Ctrl+X or Ctrl+D
Delete
Delete previous character
Ctrl+H, or Backspace, or Delete
Backspace
Delete previous word
Ctrl+W, or Esc-Delete
 
Generate IDL keyboard
interrupt
Ctrl+C
Ctrl+break
Move back one line in
recall buffer
Ctrl+N, Up arrow
Up arrow
Move forward one line in
recall buffer
Down arrow
Down arrow
Redraw current line
Ctrl+R
 
Overstrike/Insert
Esc-I
 
EOF if current line is
empty, else EOL
Ctrl+D
 
Search recall buffer for text
Available only in command-line mode. Enter ^ , then input search string at prompt.
 
Insert the character at the current
Executive Commands position
any character
any character

The command recall feature is enabled by setting the system variable !EDIT_INPUT to a non-zero value (the default is 1) and is disabled by setting it to 0. See !EDIT_INPUT for details.

Copying and Pasting Multiple IDL Code Lines

You can paste multiple lines of text from the clipboard to the command line. You simply need to place some text in the clipboard and paste it into the command line. Any source of text is valid, with emphasis on the requirement that the text be convertible to ASCII. When copying text from an IDE editor, the selection mode can be stream, line, or box.

Note
Line and box modes automatically put a trailing carriage return at the end of the text. When pasted, the last line is executed.

Be sure when you paste multiple lines that they only contain a single IDL command or are lines which include statements that utilize line continuation characters ($). Multi-line statements will produce unintended IDL interpreter behavior or errors.

Lines are transferred to the command line as is. Namely, leading white space is not removed and comment lines are sent to the IDL interpreter without distinction.

Note
Tabs are converted to white space based on the tab size indicated by the IDE editor preferences.

Changing the Number of Lines Saved

You can change the number of command lines saved in the recall buffer by setting !EDIT_INPUT equal to a number other than one (in the IDL Development Environment, you can set this value via the General tab of the IDLDE Preferences dialog as well.) In order for the change to take effect, IDL must be able to process the assignment statement before providing a command prompt. This means that you must put the assignment statement in the IDL startup file. (See Startup Files for more information on startup files.)

For example, placing the line

 
!EDIT_INPUT = 50 

in your IDL startup file changes the number of lines saved in the command recall buffer to 50.

See !EDIT_INPUT and General Preferences for additional details.


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]