Open Window

From BR Wiki
Revision as of 18:51, 28 January 2013 by Laura (talk | contribs) (Created page with "See also: Parent=None and Picture The '''OPEN window''' (OPE) statement specifies the characteristics for a window and activates the window for input/output. OPEN...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

See also: Parent=None and Picture

The OPEN window (OPE) statement specifies the characteristics for a window and activates the window for input/output. OPEN window can specify the following window characteristics: screen placement and dimensions, border type and attributes, attributes to be used for the text area of the window, and a caption to be displayed within the top border of the window.

1.) When a file is opened for both SHR and INPUT, Business Rules will no longer change the time and date of the file. As a result of this change, when a file is to be opened both for OUTIN and for INPUT, the OPEN for OUTIN must be executed first. Otherwise an error 0608 will result. This will affect current programs.
2.) The OPEN window statement now allows for flexibility in the specification of window coordinates. Previously all four coordinates of the window had to be specified in terms of two exact row positions and two exact column positions. With release 3.50, only one exact row position and one exact column position must be specified. Business Rules will automatically calculate the other row and/or column position according to the values of the ROWS= and COLS= parameters, which indicate the desired length or width of the window.

The ROWS= parameter may be used in place of either the SROW= or the EROW= parameter, but not both. Likewise, the COLS= parameter may be used in place of either the SCOL= or the ECOL= parameter, but not both. The following examples show some of the possibilities that are available using this syntax option. Each statement opens a 10 row by 10 column window in the upper left corner of the screen. (NOTE: ROWS= and COLS= parameters are shown in lowercase for emphasis; case makes no difference in actual syntax.)

00010 OPEN #1:"rows=10,cols=10,EROW=10,ECOL=10",DISPLAY,OUTPUT
00020 OPEN #1:"rows=10,SCOL=1,EROW=10,cols=10",DISPLAY,OUTPUT
00030 OPEN #1:"rows=10,SCOL=1,EROW=10,ECOL=10",DISPLAY,OUTPUT
00040 OPEN #1:"SROW=1,cols=10,rows=10,EROW=10",DISPLAY,OUTPUT
00050 OPEN #1:"SROW=1,cols=10,EROW=10,ECOL=10",DISPLAY,OUTPUT
00060 OPEN #1:"SROW=1,SCOL=1,rows=10,cols=10",DISPLAY,OUTPUT
00070 OPEN #1:"SROW=1,SCOL=1,rows=10,ECOL=10",DISPLAY,OUTPUT
00080 OPEN #1:"SROW=1,SCOL=1,EROW=10,cols=10",DISPLAY,OUTPUT
3.) The OPEN window statement's BORDER parameter now accepts S (drop-shadow) as an attribute for the border. See "S Attribute" in the BRConfig.sys Specification section for more information.
4.) The NOCLOSE parameter in any OPEN statement will leave that file open when a program ends or chains to another program. The only way this file is closed is by explicitly closing the file, CLEAR ALL, or by exiting from Business Rules.
00010 OPEN #1:"NAME=TEST,NOCLOSE",INTERNAL,RELATIVE,INPUT

Comments and Examples

Business Rules creates two different types of windows: windows that are opened as separate input/output files, and field help windows. The OPEN window statement allows you to create the first type, windows that accept input and output. For information about field help windows, see Screen I/O.

Syntax

Supplemental Syntax ("BORDER= spec")

Defaults

1.) No border.
2.) N (normal).
3.) No caption.
4.) Center caption.
5.) Interrupt the program if an error occurs and ON is not active.
6.) N (normal).

Parameters

"Wind-num" is a file number for the window being opened. It must be a numeric expression or integer that equals a value from 1 to 127, inclusive. No other open file or open window may use the same value. Open windows do not count against the operating system limit on open files.

From this point, there are two possible paths through the OPEN window syntax. The top path will be described first.

The "SROW = row" parameter identifies the starting row for the window. The "row" portion of this parameter represents any value from 1 to 24 (unless a border is specified for the window -then the value must be from 2 to 23) that does not exceed the value of the ending column.

The "SCOL = column" parameter identifies the starting column for the window. The "column" portion for this parameter represents any value from 1 to 80 (unless a border is specified for the window -then the value must be from 2 to 79) that does not exceed the value of the ending column.

The "EROW = row" parameter identifies the ending row for the window. The "row" portion of this parameter represents any value from 1 to 24 (unless a border is specified for the window -then the value must be from 2 to 23) that does not precede the starting row value.

The "ECOL = column" parameter identifies the ending column for the window. The "column" portion of this parameter represents any value from 1 to 80 (except for when a border is specified for the window -then the value must be from 2 to 79) that is not less than the starting column value.

The "BORDER=spec" parameter represents an insert-able syntax that specifies the visual characteristics of the window border. The BORDER= keyword must be followed by one of six border specifications. "B" indicates that the border is to be blank (this works well when followed by the R (reverse) attribute); "D" indicates a double-line border; "H" indicates that a shadowed or highlighted border should be used; and "S" indicates that a single-lined border should be used. SEE the Screen I/O for illustrations and more information about these border types. The "corners" and "8 chars" border specifications may be used for custom-designed window borders. SEE the Screen I/O for illustrations and more information about using these graphics border specifications.

Also within the BORDER= syntax, the "attributes" parameter may be specified immediately after the border specification (no spaces). The attributes specified here will affect the visual display of the border itself. SEE the Definitions chapter for the correct syntax to be used with the "attributes" parameter.

Going back to the main syntax for OPEN window, the next available parameter is "N=attributes". This parameter identifies the attributes that are to affect the entire inner portion of the window. However, the attribute specified takes effect only after a PRINT NEWPAGE has been sent to the window. The B (blink) attribute is not available for this parameter.

The "CAPTION=" keyword is used to identify text that is to appear in the top border of the window. It may optionally be followed by either a less-than (<) symbol for flush left text or a greater-than (>) symbol for flush right text. When no symbol is specified, the text is centered. The "title" parameter represents the text that is to be displayed.

All of the parameters described above (excluding the wind-num parameter) comprise the file definition string. The alternative to coding these parameters directly in the OPEN window statement is to reference them with the "string-expr" parameter (SEE the bottom path of the syntax diagram).

No matter which path you choose for providing the file definition, two of the remaining parameters in the syntax diagram must be included in your OPEN window statement. "DISPLAY" identifies the window file as a display file, and one of the "INPUT", "OUTPUT" or "OUTIN" parameters must be used to indicate how the window will be used.

The "error-cond line-ref" parameter allows for error processing. See Error Conditions for more information.

Technical Considerations

1.) Relevant error conditions are: ERROR, Exit and IOERR.
2.) Open window files do not count against your operating system limit on open files.
3.) Using CONFIG SCREEN N xx to change the normal attribute of a window will only take affect on windows that are opened after the CONFIG SCREEN specification is executed. This applies only to the N (normal) attribute.
4.) Unix / Linux terminals - See Terminal Consideration for special considerations when using windows with Unix / Linux terminals.