Command Reference : Object and Command Basics : Using Commands
  
Using Commands
 
Interactive Use
Command Window Editing
Command and Capture Window Docking
Floating
Docking
Pinning
Keyboard Focus
Batch Program Use
Commands may be used interactively or executed in batch mode.
Interactive Use
The command window is located (by default) just below the main menu bar at the top of the EViews window. A blinking insertion cursor in the command window indicates that keyboard focus is in the command window and that keystrokes will be entered in the window at the insertion point. If no insertion cursor is present, simply click in the command window to change the focus.
To work interactively, you will type a command into the command window, then press ENTER to execute the command. If you enter an incomplete command, EViews will open a dialog box prompting you for additional information.
A command that you enter in the window will be executed as soon as you press ENTER. The insertion point need not be at the end of the command line when you press ENTER. EViews will execute the entire line that contains the insertion point.
The contents of the command area may also be saved directly into a text file for later use. First make certain that the command window is active by clicking anywhere in the window, and then select File/Save As… from the main menu. EViews will prompt you to save an ASCII file in the default working directory (default name “commandlog.txt”) containing the entire contents of the command window.
Command Window Editing
When you enter a command, EViews will add it to the list of previously executed commands contained in the window. You can scroll up to an earlier command, edit it, and hit ENTER. The modified command will be executed. You may also use standard Windows copy-and-paste between the command window and any other window.
EViews offers a couple of specialized tools for displaying previous commands. First, to bring up previous commands in the order they were entered, press the Control key and the UP arrow (CTRL+UP). The last command will be entered into the command window. Holding down the CTRL key and pressing UP repeatedly will display the next prior commands. Repeat until the desired command is displayed.
To look at a history of commands, press the Control Key and the J key (CTRL+J). This key combination displays a history window containing the last 30 commands executed. Use the UP and DOWN arrows until the desired command is selected and then press the ENTER key to add it to the command window, or simply double click on the desired command. To close the history window without selecting a command, click elsewhere in the command window or press the Escape (ESC) key.
To execute the retrieved command, simply press ENTER again. You may first edit the command if you wish to do so.
You may resize the command window so that a larger number of previously executed commands are visible. Use the mouse to move the cursor to the bottom of the window, hold down the mouse button, and drag the bottom of the window downwards.
Command and Capture Window Docking
The EViews 9 command and capture windows are dockable, hideable, and floatable.
Dockable and hideable windows allow you to move frequently used windows out of the way while keeping them close at hand. They offer space saving convenience which is particularly valued when working with smaller screen devices like laptops.
Floatable windows allow you to move them out of the way of your work. You may even go so far as to float a window outside of the EViews frame.
To re-arrange the layout of the Command or Capture window, first make sure the window pane is not in sliding mode (the Pin icon should be IN so that it is vertical).
Then drag the window to the desired location or dock.
Note that it is possible to drag a window into an unwanted position where it covers a portion of a window with which you wish to work. In most cases, you may simply move the window out of the way. If it is difficult to drag the window because you cannot see the titlebar, you should be able use the scroll bars to gain easier access to the titlebar of the window.
Floating
You can drag the window to a new location just like any other window in EViews. However, unlike other EViews windows, You can drag the command window outside of the EViews frame:
Docking
Both the command and capture window panes can now be docked on any side inside the main EViews window. Begin dragging the pane by left-clicking title bar and holding it down as you drag it off the edge. At that point, you will see small docking guides appear inside the main EViews window:
To dock the window, you will drag it to one of the docking guides. The docking behavior will depend on which guide you select.
The docking guides allow you to dock the window pane to one of eight pre-defined areas. The four guides on the outer edge of the main window allow you to dock the window as the primary pane while the inner guides allow you to dock the window as a secondary pane. Primary panes take over the entire length of the selected edge and force other docked panes that could intersect to become smaller to compensate. Secondary panes only take over the portion of the selected edge that is not already occupied.
For example, if the capture pane is dragged to the right-most docking guide like this:
and then released, the final layout looks like this
Because it is primary, it pushes the docked Command window pane at the top of the window to become smaller.
Alternatively, if the inner right guide was selected instead like this:
the final layout would look like this
Docking two panes onto the same primary edge can result in stacking, with the recently moved pane being adjacent to the edge (as the primary), and any secondary panes being stacked next to the primary pane (in the order they were docked).
You can also dock a pane inside another pane in order to use the share the same space. If you drag a pane over another pane, you are presented with additional docking guides inside the other pane:
For example, selecting the inner-right guide area allows the Capture pane to appear to the right of the Command pane with an adjustable split bar to let you resize the split:
The docking guide also offers an additional guide area directly in the center that allows you to convert both panes into a tabbed view:
Pinning
If your window is docked, you can “pin” it by clicking on the pin icon (so that it is horizontal). When pinned, the window will be minimized and a small tab will be displayed in the docked location.
To expand the pinned window, simply click on the tab. The window will automatically contracts when it loses focus. Clicking on the Pin icon again will “un-pin” and expand the window permanently.
Keyboard Focus
We note that as you open and close object windows in EViews, the keyboard focus may change from the command window to the active window. If you then wish to enter a command, you will first need to click in the command window to set the focus. You can influence EViews’ method of choosing keyboard focus by changing the global defaults—simply select Options/General Options.../Window Behavior in the main menu, and change the Keyboard Focus setting as desired.
Batch Program Use
You may assemble a number of commands into a program, and then execute the commands in batch mode. Each command in the program will be executed in the order that it appears in the program. Using batch programs allows you to make use of advanced capabilities such as looping and condition branching, and subroutine and macro processing. Programs also are an excellent way to document a research project since you will have a record of each step of the project. Batch program use of EViews is discussed in greater detail in “EViews Programming”.
One way to create a program file in EViews is to select File/New/Program. EViews will open an untitled program window into which you may enter your commands. You can save the program by clicking on the Save or SaveAs button, navigating to the desired directory, and entering a file name. EViews will append the extension “.PRG” to the name you provide.
Alternatively, you can use your favorite text (ASCII) editor to create a program file containing your commands. It will prove convenient to name your file using the extension “.PRG”. The commands in this program may then be executed from within EViews.
You may also enter commands in the command window and then use File/Save As... to save the log for editing.