PV-WAVE Foundation > User Guide > Getting Started: Windows > Entering Commands at the Command Line
Entering Commands at the Command Line
This section discusses ways to communicate with PV‑WAVE.
When the WAVE> prompt is visible, you are located at the PV‑WAVE command line. The command line gives you immediate access to all the data analysis and graphics display commands and procedures that are part of PV‑WAVE.
 
note
The PV‑WAVE Reference describes all of the PV‑WAVE commands (functions and procedures).
As you enter commands at the keyboard, they are compiled and executed immediately. You see the data transformations and results on your computer screen instantly.
When using the command line, data analysis is quick and simple. Using PV‑WAVE commands, you read in the data and, within seconds, you can begin manipulating it, discovering what trends and patterns it holds.
The following statements can be entered directly at the WAVE> prompt. They create and initialize the variables VERBM, VERBF, MATHM, and MATHF, which contain the verbal and math SAT scores for males and females:
VERBM = [463, 459, 437, 433, 431, 433, 431, 428, 430, 431, 430]
VERBF = [468, 461, 431, 430, 427, 425, 423, 420, 418, 421, 420]
MATHM = [514, 509, 495, 497, 497, 494, 493, 491, 492, 493, 493]
MATHF = [467, 465, 449, 446, 445, 444, 443, 443, 443, 443, 445]
A vector in which each element contains the year of the score is constructed with the statement:
YEAR = [1967, 1970, INDGEN(9) + 1975]
The PLOT procedure, which produces an x versus y plot on a new set of axes, requires one or two parameters: a vector of y–values, or a vector of x–values followed by a vector of y–values. Figure 3-2: 2D Plot is produced using the statement:
PLOT, YEAR, VERBM
 
Figure 3-2: 2D Plot
 
Function and Procedure Libraries
Some functions and procedures come from an area known as the Standard Library. These are routines that have been written using the PV‑WAVE language and are fully supported by Rogue Wave Software, Inc. The source code for Standard Library routines can be found in:
(WIN) <wavedir>\lib\std
You can also use functions and procedures from the User Contributed Library in:
(WIN) <wavedir>\lib\user
Where <wavedir> is the main PV-WAVE directory.
Remember, however, that the routines in this area are not officially supported by Rogue Wave Software, Inc.
For more information about how the Users’ Library is maintained, see the PV‑WAVE Programmer’s Guide.
Using Keywords to Modify Commands
Keywords are optional parameters that modify PV‑WAVE commands. The PV‑WAVE Reference lists every keyword associated with each command. For example, the PLOT command, which is used to create 2D line plots, has dozens of keywords associated with it. These keywords can be used to add titles, change the color, thickness, and style of lines, modify the way axis tick marks appear, change the data range, add symbols, and many more.
The following example plots the values in the variable y. The keywords used to modify the plot are shown in bold type:
PLOT, y, XRange = [200, 600], YRange = [-40, 40], Color = 36, $
Background = 110, XTitle = 'Index', $
Title = 'PV-WAVE 2D Plot', /Normal
Notice that keywords are normally assigned either a numerical or string value. Some keywords are Boolean in nature and can either be on or off. To turn such a keyword “on”, set it equal to 1 or precede the keyword by a / (slash). Preceding a keyword by a slash is equivalent to setting it equal to 1. To turn it “off” set it to 0. For example:
PLOT, y, /Polar
and:
PLOT, y, Polar = 1
are equivalent statements. They both activate the Polar keyword, which creates a polar plot instead of a Cartesian X-Y plot.
Most keywords have default values. The default for the Polar keyword is 0, or inactive. The default values for some keywords are determined by system variables.
Keywords may be abbreviated to the shortest non-ambiguous string.
 
note
When shortening a keyword, you should always use at least three characters to ensure that PV-WAVE correctly identifies the keyword. Otherwise, as new keywords are added to routines, it is possible for PV-WAVE to misidentify a new keyword as an older keyword.
Relationship Between Keywords and System Variables
For some keywords, the default values are derived from system variables. System variables are a special class of predefined variables available to all PV‑WAVE applications. All system variables are denoted with an initial exclamation point (!). For example, the system variable !P.Color contains the default setting for the keyword Color.
When using many plotting functions and procedures, the keyword Color can be used to change the value of !P.Color. Here’s an easy way to use a system variable to change the value of !P.Color to a bright purple color:
; This command loads 32 predefined, unique, highly-saturated 
; colors into the bottom 32 indices of the color table.
TEK_COLOR
; Changes !P.Color to purple (the color identified by the color 
; index 6). The change is temporary — it only lasts until some 
; other color table is loaded or until you end your PV‑WAVE 
; session. For more permanent results, you can save your session, 
; and then this setting is available for later use.
!P.Color = 6
For more information about system variables, see the PV‑WAVE Programmer’s Guide. For more information about saving sessions, see "Saving and Restoring PV-WAVE Sessions" of this manual.
Using Command Recall
To recall previously entered commands, use the arrow keys as follows.
*To move “up”, press the up arrow ().
*To move “down”, press the down arrow ().
The command recall buffer “remembers” the last 20 commands that you have entered.