Release 10.1A: OpenEdge Development:
Progress 4GL Reference

> ## TERMINAL statement

> Changes terminal type during program execution. On UNIX, changes the value of the TERM environment variable.

> Note: Does not apply to SpeedScript programming.

> #### Syntax

>     TERMINAL = termid

> ``termid``

> A terminal type string. The `termid` can also be an expression. Progress returns an error message if `termid` is not defined in the PROTERMCAP file. However, `termid` can be the word TERMINAL. The line TERMINAL=TERMINAL reinitializes the terminal.

> Example

> This procedure changes the terminal screen width from 80 columns to 132 columns, then back again:

> r-seterm.p
>     FOR EACH customer:
>       DISPLAY customer.
>     END.

>     TERMINAL = "wy60w".
>     OUTPUT TO TERMINAL PAGED.
>     FOR EACH customer:
>       DISPLAY customer WITH WIDTH 132.
>     END.

>     OUTPUT CLOSE.
>     TERMINAL = "wy60".
>     DISPLAY "Back to 80 columns." WITH CENTERED.

> #### Notes

> - TERMINAL does not change the physical characteristics of a terminal. You must supply a valid terminal type for the existing terminal state.

> - The TERMINAL statement reinitializes the function key definitions based on the specified PROTERMCAP entry. If you have used ON statements to change function key definitions, the TERMINAL statement overrides those changes.

> - If a subprocedure uses a frame, the frame is composed with the width that was in effect when the subprocedure was compiled. Changing the width (terminal type) outside the scope of that procedure will not change the frame width inside the procedure unless it is recompiled.

> The following sequence of statements does not work as intended, because `subp.p` is not recompiled before its second execution:

> r-setrm1.p
>     TERMINAL = "wy60w".
>     RUN subp.p.
>     TERMINAL = "wy60".
>     RUN subp.p.
>     DISPLAY "Frame (132) too big for screen (80)" WITH CENTERED.

> #### See also

> TERMINAL function

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095