Last modified: Tue, 06/23/2020 - 09:36
Commands in program Ferret conform to the following template:
COMM [/Q1/Q2...] [SUBCOM[/S1/S2...]] [ARG1 ARG2 ...] [!comment]
where
COMM |
is a command name yes? LIST |
Q1... |
are qualifiers of the command yes? CONTOUR/SET_UP |
SUBCOM |
is a subcommand name yes? SHOW MODE |
S1... |
are qualifiers of the subcommand yes? SET LIST/APPEND |
ARG1... |
are arguments of commands yes? CANCEL MODE INTERPOLATE |
notes...
- The length of the command line is limited to a maximum of 2048 characters.
- Command lines ending with back slash are regarded as incomplete -- a special prompt is given to indicate that the next line is a continuation.
- In the documentation, items in square brackets are optional. In commands themselves, square brackets modify a variable with information about the context (e.g the region, data set or transformation.)
- One or more spaces or tabs must separate the command from the subcommand and from each of the arguments. Spaces and tabs are optional preceding qualifiers.
- Multiple commands, separated by semicolons, can be given on the same line (e.g. yes? CANCEL DATA/ALL; CANCEL VAR/ALL).
- Command names, subcommand names, and qualifiers require at most 4 characters.
(e.g., yes? CANCEL LIST/PRECISION is equivalent to yes? CANC LIST/PREC)
- Some qualifiers take an argument following "=" (e.g., yes? LIST/Y=10S:10N).
- An exclamation mark normally signifies the end of a command and the start of (optional) comment text.
- The backslash character (\), when placed directly before an exclamation point (!), apostrophe ('), semicolon (;), or forward slash (/), will hide it ("escape it") from Ferret.
- See the Expressions section for information on algebraic expressions as arguments to commands.
- See the Symbols sections for information on symbol substitution in commands.
- A simple command and argument
yes? LIST sst - A comment on the command line
yes? SET REGION/L=1/X=130:290/Y=-23:23 ! January in the Tropical Pacific - Commands with qualifiers and arguments
yes? VECTOR/L=30/COLOR=RED u,v
yes? LET/UNITS=M ht = z[GZ=temp] - z0 - Subcommands
yes? SET MODE METAFILE
yes? SET REGION/X=130E:120W/J=20:40/Z=0/T=1-jan-1982:31-jan-1992 - Symbols used in a command. Note multiple commands on a line
yes? DEFINE SYMBOL lower = -2; DEFINE SYMBOL upper = 6
yes? SHADE/I=($lower):($upper) temp - Use Square brackets to specify a variable's dataset or grid, range and optionally a delta- for the variable, or a transformation )
yes? PLOT temp[X=180,L=1:50]
or
yes? LIST temp[X=130:200@AVE,L=1:50:5]
or
yes? LET/UNITS=M ht = z[GX=temp] - z0 - Immediate mode expression: enclosed in grave accents. (The expression must evaluate to a scalar, and is evaluated before the command is parsed or executed.)
yes? CONTOUR/Z=`temp[X=180,Y=0,Z=@LOC:15]` salt - A list of values (constant array) may be formed by enclosing values in curly brackets. For example in a function call:
yes? LET aday = DAYS1900(1989,{3,6,9},1) - Text for labels is enclosed in double quotes
yes? VECTOR/TITLE="title_string" x_expr, y_exprIf the string is to contain a quote, the backslash preserves it:
yes? GO my_go_script "\"(-10,10,2)"\"
sends the string "(-10,10,2)" to the script for more on go scripts