User Guide > Getting Started: UNIX > Entering Commands at the Command Line
  

Entering Commands at the Command Line
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.
For example, the following command produces an XY plot of the integers 0 to 99:
WAVE> PLOT, INDGEN(100)
 
note
The commands PLOT and INDGEN are PV‑WAVE system routines. There are many such routines, which are all documented in the PV‑WAVE Reference.
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. Here are some additional examples of commands entered directly at the PV‑WAVE command line.
WAVE> x = 7*8 ; Assign the value of 7 times 8 to the variable x.
; Print the string “x = ” and the value of x which is 56.
WAVE> PRINT, ’x = ’, x
; x = 56 
; This command tells PV‑WAVE to use the PostScript driver to
; produce graphics output for a PostScript printer or plotter.
WAVE> SET_PLOT, ’PS’
; Compiles and runs file named testfile. If this is not found in
; the current directory, the directory search path is examined.
WAVE> .RUN testfile
; This statement calculates the square of the numbers 1 through 3.
WAVE> FOR I = 1,3 DO PRINT, I, I^2
; 1			 1
; 2 4
; 3 9
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 documented and supported by Rogue Wave Software, Inc.
You can also use functions and procedures from the Users’ Library. This library contains many useful routines that have been written and submitted by PV‑WAVE users; however, the routines in this area are not officially supported by Rogue Wave Software, Inc.
The source code for Standard Library routines is in:
(UNIX) <wavedir>/lib/std
The source code for Users’ Library routines is in:
(UNIX) <wavedir>/lib/usr
Where <wavedir> is the main PV-WAVE directory.
For more information on the Users’ Library, 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.
In the following example, the keyword used to modify the plot is shown in bold type:
PLOT, INDGEN(100), Title = ’Hello World’
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, INDGEN(100), INDGEN(100), /Polar
and
PLOT, INDGEN(100), INDGEN(100), 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, which 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 Sessions" in this manual.

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.