• Aucun résultat trouvé

Using DM Special Characters

Dans le document apollo BSD (Page 79-84)

When you use commands in scripts and key definitions, you can use several special characters that control how the OM interprets commands. The following describes the rules for using these spe-cial characters:

@ The escape character (@) always nullifies the meaning of any special character (e.g., the input request character) it precedes. When the OM reads a command line containing the escape character, it strips off the @ character, and any special meaning of the character following it.

If you can't remember whether a character has some spe-cial meaning, it is safe to escape the character. If the character is not special, the OM still removes the @, so the character appears as it should. Character escaping is gen-erally confined to search and substitute operations (see Chapter 5), commands requiring quoted strings, and key definitions.

# When the OM reads the pound sign (#) in a OM script, it ignores the information on the remainder of the line. Use this character to add comments to your OM script or to prevent the execution of a line in the script.

Use the semicolon (;) to separate commands that you specify on the same line.

4-4 Using the Display Manager

& The input request character (&) enables you to supply keyboard input from the OM input pad to a command in a key definition or script. When the OM reads the &, it stops reading commands and moves the cursor to the OM input pad. When you enter input (usually a command argument), the OM replaces the & character with the specified input and continues reading commands. You can also specify a prompt in the form com-mand does not recognize single quotes within the definition string.

Defining Points and Regions

As noted earlier, you may specify the location for a OM operation by using either the cursor or an explicit coordinate list.

If you use the cursor, remember that it actually occupies many indi-vidual screen points. When you use the cursor to point to a spot on the screen, the lower left-hand corner of the block cursor desig-nates the exact point. (When you point to the upper edge or right edge of a window, the OM adjusts the point position to account for the size of the cursor. See the "Creating Pads and Windows" sec-tion in Chapter 5 for more informasec-tion on how the OM defines win-dow boundaries.)

Specifying Points on the Display

If you choose not to point with the cursor, you can explicitly define a point or pair of points (a region) using any of the point formats described below. Note that some formats define points in pads, and others define points on the display as a whole. You normally define points in pads when performing the pad editing operations de-scribed in Chapter 6.

Using the Display Manager 4-5

line-number

Specifies a line location in a pad. Line numbers begin at 1 and increase moving toward the last line in the pad. To re-fer to the last line in a pad, you may specify a dollar sign

($). The edit pad window legend displays the line number of the top line in a window. You can also display the line number (plus the column number, and x- and y-coordi-nates) of the current cursor position by using the D1\1 com-mand

=.

+/- n

Specifies a line location in a pad that is n lines before (-) or after (+) the current cursor position.

[ line-number] [ ,column-number ] ]

Specifies a point in a pad by line and column number. The DM assumes the current line if you omit line-number; it assumes column 1 if you omit column-number. Line bers range from 1 to the last line in the pad. Column num-bers range from 1 to 256. Some examples are:

[ 127,14) [ 53 ] [ ,12 ]

Line 127, column 14.

Line 53, column 1.

Column 12 of the current line.

Note that you must use the outer set of square brackets;

however, when you specify line-number only, the brackets are optional. When using this format, you cannot use the dollar sign ($) to specify the last line in a pad; you must specify the number of the last line.

/regular-expression/ or \regular-expression\

Specifies a string in a pad that begins or ends a specific re-gion. Chapter 6 describes regular expressions.

4-6 Using the Display Manager

( [x-coordinate] [ ,y-coordinate] )

Specifies a point on the display by screen coordinates.

Screen coordinates indicate bit positions on the display.

The origin 0,0 is at the extreme upper-left comer of the screen. Table 4-1 shows the ranges for coordinate values.

Table 4-1. Ranges for Coordinate Values

Display Type x-coordinate y-coordinate

1024x800

o

to 1023

o

to 799

1280x1024 (landscape)

o

to 1279

o

to 1023 800x1024 (portrait)

o

to 799

o

to 1023 1024x1024 (square)

o

to 1023

o

to 1023

If you omit either coordinate from the specification, the DM uses the coordinates of the cursor. You must enclose the coordinates in parentheses. Some examples are:

(200,450) (135)

(,730)

Bit position with an x-coordinate of 200 and a y-coordinate of 450.

Bit position with an x-coordinate of 135 and the same y-coordinate as the current cursor position.

Bit position with the same x-co-ordinate as the current cursor position, and a y-coordinate of 730.

When you specify any of the formats described above in the DM input pad, the DM moves the cursor to the specified position. For example, to move the cursor to line 75, column 5 in an edit pad, specify the following in the DM input pad:

Command: [75,5]

Using the Display Manager 4-7

You can also use any of the formats for defining points to define a region on the display. To define a region, you must define two points as follows:

[point] dr; [point]

The first point defines the beginning of the region and the dr com-mand marks it. The second comcom-mand defines the end of the re-gion. When defining a two-dimensional region, the first point de-fines one comer, and the second point dede-fines the opposite comer as shown in Figure 4-2.

Figure 4-2. Defining a Display Region

When you define a region, if you don't specify a second position, the DM uses the current cursor position.

Like defining a single point, an easy way to define a region is to point with the cursor. Press <MARK> to invoke the dr command, which marks the first point. To define a region using the cursor:

1. Move the cursor to the first point.

2. Press <MARK>.

4-8 Using the Display Manager

3. Move the cursor to the second point.

4. Specify the DM command.

For a complete description of the DM commands used to control marks, see the Domain Display Manager Command Reference.

For commands that require a region in which to operate, you have the option of specifying the region as part of the command. The cv (create view) command, shown below, creates a read-only pad and window. It uses a region to define the size and location of the win-dow it creates.

Command: (350,200) dr; (700,600) region

I

cv report_file command

~

Dans le document apollo BSD (Page 79-84)

Documents relatifs