Document revision date: 19 July 1999
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

Guide to the DEC Text Processing Utility


Previous Contents Index

3.12 Unspecified Data Type

An unspecified value is the initial value of a variable after it has been compiled (added to the DECTPU symbol table). In the following example, the COMPILE built-in procedure creates the variable x and initially gives it the data type unspecified unless x has previously been declared as a global variable:


COMPILE ("x := 1"); 

An assignment statement that creates a variable must be executed before a data type is assigned to the variable. In the following example, when you use the EXECUTE built-in procedure to run the program that is stored in the variable prog, the variable x is assigned an integer value:


prog := COMPILE ("x := 1"); 
EXECUTE (prog); 

To give a variable the data type unspecified, assign the predefined constant TPU$K_UNSPECIFIED to the variable:


prog := TPU$K_UNSPECIFIED; 

3.13 Widget Data Type

The DECwindows version of DECTPU provides the widget data type to support DECwindows widgets. The non-DECwindows version of DECTPU does not support this data type.

A widget is an interaction mechanism by which users give input to an application or receive messages from an application.

You can use the equal operator (=) or the not-equal operator (<>) on widgets to determine whether they are equal (that is, whether they are the same widget instance), but you cannot use any other relational or arithmetic operators on them.

Once you have created a widget instance, DECTPU does not delete the widget instance, even if there are no variables referencing it. To delete a widget, use the DELETE built-in procedure.

DECwindows DECTPU provides the same support for DECwindows gadgets that it provides for widgets. A gadget is a structure similar to a widget, but it is not associated with its own unique DECwindows window. Gadgets do not require as much memory to implement as widgets do. In most cases, you can use the same DECwindows DECTPU built-ins on gadgets that you use on widgets.

For more information on widgets or gadgets, see the OpenVMS overview documentation.

3.14 Window Data Type

A window is a portion of the screen that displays as much of the text in a buffer as will fit in the screen area. In EVE, the screen contains three windows by default: a large window for viewing the text in your editing buffer and two one-line windows for displaying commands and messages. In EVE or in a user-written interface, you can subdivide the screen to create more windows.

A variable of the window data type "contains" a window. The CREATE_WINDOW, CURRENT_WINDOW, and GET_INFO built-in procedures return a value of the window data type. CREATE_WINDOW is the only built-in procedure that creates a new window. The following example assigns a value of the window data type to the variable x:


x := CREATE_WINDOW (1, 12, OFF); 

The first parameter specifies that the window starts at screen line number 1. The second parameter specifies that the window is 12 lines in length. The OFF keyword specifies that a status line is not to be displayed when the window is mapped to the screen.

3.14.1 Defining Window Dimensions

Windows are defined in lines and columns. In EVE, all windows extend the full width of the screen or terminal emulator. In DECTPU, you can set the window width to be narrower than the width of the screen or terminal emulator.

The allowable dimensions of a window often depend on whether the window has a status line, a horizontal scroll bar, or both. A status line occupies the last line of a window. By default, a status line contains information about the buffer and the file associated with the window. You can turn a status line on or off with the SET (STATUS_LINE) built-in procedure.

A horizontal scroll bar is a one-line widget at the bottom of a window that you can use to shift the window to the right or left, controlling what text in the buffer can be seen through the window. You can turn a horizontal scroll bar on or off with the SET (SCROLL_BAR) built-in procedure.

Lines on the screen are counted from 1 to the number of lines on the screen; lines in a window are counted from 1 to the number of lines in the window. Columns on the screen are counted from 1 to the physical width of the screen; columns in a window are counted from 1 to the number of columns in the window.

The minimum length for a window is one line if you do not include a status line or horizontal scroll bar, two lines if you include either a status line or a horizontal scroll bar, and three lines if you include both a status line and scroll bar.

The maximum length of a window is the number of lines on your screen. For example, if your screen is 24 lines long, the maximum size for a single window is 24 lines. On the same size screen, you can have a maximum of 24 visible windows if you do not use status lines or horizontal scroll bars. If you use a status line and a horizontal scroll bar for each window, the maximum number of visible windows is 8.

3.14.2 Creating Windows

When you use a device that supports windows (see Appendix B for information on terminals that DECTPU supports), you or the section file that initializes your application must create and map windows. In most instances, it is also advisable to map a buffer to the window. To map a buffer to a window, use the MAP built-in procedure. If you do not associate a buffer with a window and map the window to the screen, the only items displayed on the screen are messages that are written to the screen at the cursor position.

The CREATE_WINDOW built-in procedure defines the size and location of a window and specifies whether a status line is to be displayed. CREATE_WINDOW also adds the window to DECTPU's internal list of windows available for mapping. At creation, a window is marked as being not visible and not mapped and the following values for the window are calculated and stored:

Later calls to ADJUST_WINDOW may change these values.

3.14.3 Displaying Window Values

When you use the CREATE_WINDOW built-in procedure to create a window, DECTPU saves the numbers of the screen lines that delimit the window in original_top and original_bottom. When you map a window to the screen with the MAP built-in procedure, the window becomes visible on the screen. If it is the only window on the screen, its visible_top and visible_bottom values are the same as its original_top and original_bottom values. You can use SHOW (WINDOWS) to display the original and the visible values or the GET_INFO built-in procedure to retrieve them.

However, if there is already a window on the screen and you map another window over part of it, the values for the previous window's visible_top, visible_bottom, and visible_length are modified. The value for visible_length of the previous window is different from its original_length until the new window is removed from the screen. As long as the new window is on the screen and does not have another window mapped over it, its original top and bottom are the same as its visible top and bottom.

3.14.4 Mapping Windows

When you want a window and its associated buffer to be visible on the screen, use the MAP built-in procedure. Mapping a window to the screen has the following effects:

Mapping a window to the screen may have the following side effects:

When a newly mapped window becomes the current window (the MAP, POSITION, and ADJUST_WINDOW built-in procedures cause this to happen), the cursor is placed in the current window. In addition to the active cursor position in the current window, there is a marker that designates a cursor position in all other windows. The cursor position in a window other than the current window is the last location of the cursor when it was in the window. By maintaining a cursor position in all windows, DECTPU lets you edit in multiple locations of a single buffer if that buffer is associated with more than one window.

For more information on the cursor position in a window and the POSITION built-in procedure, see the DEC Text Processing Utility Reference Manual.

3.14.5 Removing Windows

To remove a window from the screen, you can use either the UNMAP built-in procedure or the DELETE built-in procedure. UNMAP removes a window from the screen. However, the window is still in DECTPU's internal list of windows. It is available to be remapped to the screen without being re-created. DELETE removes a window from the screen and also removes it from DECTPU's list of windows. It is then no longer available for future mapping to the screen.

Unmapping or deleting a window has the following effects:

3.14.6 Using the Screen Manager

The screen manager is the part of DECTPU that controls the display of data on the screen. You can manipulate data without having it appear on a terminal screen (see Chapter 5). However, if you use the DECTPU window capability to make your edits visible, the screen manager controls the screen.

In the main control loop of DECTPU, the screen manager is not called to perform its duties until all commands bound to the last key pressed have finished executing and all input in the type-ahead buffer has been processed. Upon completion of all the commands, the screen manager updates every window to reflect the current state of the part of the buffer that is visible in the window. If you want to make the screen reflect changes to the buffer prior to the end of a procedure, use the UPDATE built-in procedure to force the updating of the window. Using UPDATE is recommended with built-in procedures such as CURRENT_COLUMN that query DECTPU for the current cursor position. To ensure that the cursor position returned is the correct location (up to the point of the most recently issued command), use UPDATE before using CURRENT_COLUMN or CURRENT_ROW.

3.14.7 Getting Information on Windows

There are two DECTPU built-in procedures that return information about windows: GET_INFO and SHOW (WINDOW).

GET_INFO returns information that you can store in a variable. You can get information about the visible and original values of windows, as well as about other attributes that you have set up for your window environment. See GET_INFO in the DEC Text Processing Utility Reference Manual.

SHOW (WINDOW) or SHOW (WINDOWS) puts information about windows in the SHOW_BUFFER. If you use an editor that has an INFO_WINDOW, you can display the SHOW_BUFFER information in the INFO_WINDOW.

3.14.8 Terminals That Do Not Support Windows

DECTPU supports windows only for ANSI character-cell terminals. Noncharacter-cell terminals do not support windows and are considered "unsupported devices."

If you are using an unsupported device, you must use the /NODISPLAY qualifier when you invoke DECTPU. /NODISPLAY informs DECTPU that you do not expect the device from which you are issuing DECTPU commands to support screen-oriented editing. If one of the previous conditions exists and you do not specify the /NODISPLAY qualifier, DECTPU exits with an error condition.

You are using an unsupported device if logical name SYS$INPUT points to an unsupported device, such as a character-cell terminal.

Appendix B contains more information about DECTPU terminal support. Chapter 2 contains more information on the /NODISPLAY qualifier.


Chapter 4
Lexical Elements of the DEC Text Processing Utility Language

4.1 Overview

A DECTPU program is composed of lexical elements. A lexical element may be an individual character, such as an arithmetic operator, or it may be a group of characters, such as an identifier. The basic unit of a lexical element is a character from either the DEC Multinational Character Set or the ISO_LATIN1 Character Set.

This chapter describes the following DECTPU lexical elements:

4.2 Case Sensitivity of Characters

The DECTPU compiler does not distinguish between uppercase and lowercase characters except when they appear as part of a quoted string. For example, the word EDITOR has the same meaning when written in any of the following ways:

The following, however, are quoted strings, and therefore represent different values:

4.3 Character Sets

When you invoke DECTPU, you can use one of the following keywords with the /CHARACTER_SET qualifier to specify the character set that you want DECTPU to use:

Each character set is an 8-bit character set with 256 characters. Each character in a set is assigned a decimal equivalent number ranging from 0 to 255. Each character set uses an extension of the American Standard Code for Information Interchange (ASCII) character set for the first 128 characters. Table 4-1 shows the categories into which you can group the ASCII characters.

Table 4-1 Categories of ASCII Character Set Characters
Category Meaning
0--31 Nonprinting characters such as tab, line feed, carriage return, and bell
32 Space
33--64 Special characters such as the ampersand (&), question mark (?), equal sign (=), and the numbers 0 through 9
65--122 The uppercase and lowercase letters A through Z and a through z
123--126 Special characters such as the left brace ({) and the tilde (~)
127 Delete

The following sections discuss the types of character sets supported by DECTPU.

4.3.1 DEC Multinational Character Set (DEC_MCS)

The DEC Multinational Character Set characters from 128 to 255 are extended control characters and supplemental multinational characters. Table 4-2 shows the categories into which you can group the characters.

Table 4-2 Categories of DEC Multinational Character Set Characters
Category Meaning
128--159 Extended control characters
160 Reserved
161--191 Supplemental special graphics characters such as the copyright sign (©) and the degree sign (°)
192--254 The supplemental multinational uppercase and lowercase letters such as the Spanish Ñ and ñ
255 Reserved

For a complete list of characters in the DEC Multinational Character Set, see the OpenVMS documentation.

4.3.2 ISO Latin1 Character Set (ISO_LATIN1)

The ISO Latin1 Character Set characters from 128 to 255 are extended control characters and Latin1 supplemental multinational characters. Table 4-3 shows the groups into which you can categorize characters.

Table 4-3 Categories for ISO Latin1 Characters
128-159 Extended control characters
160-191 Latin1 supplemental graphics characters such as the nonbreaking space and the currency sign
192-255 The Latin1 supplemental uppercase and lowercase letters such as the uppercase and lowercase thorn

For a complete list of the ISO Latin1 Character Set, see the OpenVMS documentation.

4.3.3 General Character Sets

If you specify the GENERAL keyword with the /CHARACTER_SET qualifier or the -C option, DECTPU is unable to set a character set for 8-bit characters. The character set used and how DECTPU displays 8-bit characters are the same as before you started DECTPU. For this reason, the characters from 128 to 255 in the General Character Sets are not specific to any character set.

4.3.4 Entering Control Characters

There are two ways to enter control characters in DECTPU:

4.3.5 DECTPU Symbols

Certain symbols have special meanings in DECTPU. You can use them as statement delimiters, operators, or other syntactic elements. Table 4-4 lists the DECTPU symbols and their functions.

Table 4-4 DECTPU Symbols
Name Symbol DECTPU Function
Apostrophe ' Delimits a string
Assignment operator := Assigns a value to a variable
At sign @ Partial pattern assignment operator
Left brace { Opens an array element index expression
Close parenthesis ) Ends parameter list, expression, procedure call, argument list, or array element index
Comma , Separates parameters
Exclamation point ! Begins comment
Dollar sign $ Indicates a variable, constant, keyword, or procedure name that is reserved to DIGITAL
Right brace } Closes array element index expression
Equal sign = Relational operator
Greater than sign > Relational operator
Greater than or equal to sign >= Relational operator
Slash / Integer division operator
Asterisk * Integer multiplication operator
Left bracket [ Begins case label
Less than sign < Relational operator
Less than or equal to sign <= Relational operator
Minus sign -- Subtraction operator
Not equal sign <> Relational operator
Vertical bar | Pattern alternation operator
Open parenthesis ( Begins parameter list, expression, argument list, or array element index
Ampersand & Pattern linkage operator
Plus sign + String concatenation operator, pattern concatenation operator, integer addition operator
Quotation mark " Delimits string
Right bracket ] Ends case label
Semicolon ; Separates language statements
Underscore _ Separates words in identifiers


Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
6018PRO_006.HTML