 wi_open - create window
 wi_close - delete window
 wi_insln - insert line
 wi_delln - delete line
 wi_clreol - clear to end of line
 wi_clear - clear window
 wi_home - set position	to home
 wi_border - set window	border
 wi_setpos - set position
 wi_getpos - get position
 wi_setorg - set origin
 wi_getorg - get origin
 wi_put	- store	character string
 wi_putln - store character string
 wi_get	- retrieve character string
 wi_getln - retrieve character string
 wi_write - write character string through window
 wi_writeln - write character string through window
 wi_read - read	character string through window
 wi_readln - read character string through window
 wi_show - display window on screen
 wi_erase - erase window area on screen
:  wi_open - create window

  procedure  wi_open (window_number,
		       origin_column,
		       origin_row,
		       window_width,
		       window_height : integer;
		       border_chars : string[4]);

  Input	arguments:

       window_number  -	 User  assigned	 window	identification number

       origin_column -	Display	 screen	column to contain left column of window
       origin_row -  Display  screen row to contain top	row of window

       window_width - The window width expressed as number  of columns

       window_height - The window height expressed  as	number of rows

       border_chars - Window border character string

  Output arguments:

       None

  Action:

       If window_width and window_height are within range and
       window_number is	unique,	the service attempts to
       allocate	dynamic	memory for a window control block.  If
       sufficient dynamic memory is not	available to allocate
       a window	control	block, a Turbo Pascal run-time error
       results.	 The service initializes the window control
       block to	specified input	values.	 Window	contents are
       cleared.	 The window border, if specified, is stored. 

  Status:

       wi_status - True	 if  operation	successful.   False if
	 window_width or  window_height	 out  of  range, or if
	 window	 control  block	 with  the same	 window_number
	 exists. 

:  wi_close - delete window

  procedure  wi_close (window_number : integer);

  Input	arguments:

       window_number - Window identification number

  Output arguments:

       None

  Action:

       If the window is	open, the service de-allocates the
       dynamic memory required to store	the window control
       block. 

  Status:

       wi_status  -  True  if close operation is  successful. 
	 False if window is not	open. 

:  wi_insln - insert line

  procedure  wi_insln (window_number,
			window_row : integer);

  Input	arguments:

       window_number - Window identification number

       window_row - Window row number for line insert

  Output arguments:

       None

  Action:

       If the window is	open and window_row is in range, the
       window line at window_row and following lines are
       shifted down one	row.  The last user accessible line in
       the window is deleted.  A blank line is inserted	into
       the window at window_row. Window	position is set	to the
       first column of window_row. The window border, if
       present,	is unchanged.  If the window is	open and
       window_row is greater than the number of	accessible
       rows, window lines are shifted up one row.  The top
       user accessible line in the window is deleted.  A blank
       line is inserted	into the window	on the last user
       accessible row.	Window position	is set to the first
       column of the inserted row.  The	window border, if
       present,	is unchanged. 

  Status:

       wi_status - False  if  window is	not open or window_row
	 is less than 1; otherwise, true. 

:  wi_delln - delete line

  procedure  wi_delln (window_number,
			window_row : integer);

  Input	arguments:

       window_number - Window identification number

       window_row - Window row number for line delete

  Output arguments:

       None

  Action:

       If the window is	open and window_row is within range,
       the window line at window_row is	deleted	and following
       rows are	shifted	up one row.  A blank line is inserted
       at the bottom of	the window.  Window position is	set to
       the beginning of	window_row. The	window border, if
       present,	is unchanged. 

  Status:

       wi_status -  False  if window is	not open or window_row
	 is out	of range; otherwise, true. 

:  wi_clreol - clear to	end of line

  procedure  wi_clreol (window_number :	integer);

  Input	arguments:

       window_number - Window identification number

  Output arguments:

       None

  Action:

       If the window is	open and window	position is not	at end
       of window, window content from current window position
       to end of row is	set to spaces.	Window position	is not
       modified. 

  Status:

       wi_status  -  False if window is	 not  open  of	window
	 position is at	end of window when service is invoked;
	 otherwise, true. 

:  wi_clear - clear window

  procedure  wi_clear (window_number : integer);

  Input	arguments:

       window_number - Window identification number

  Output arguments:

       None

  Action:

       If the window is	open, window contents are set to
       spaces.	The window border is restored.	Window
       position	is set to home:	window column 1, row 1.

  Status:

       wi_status  -  False  if window is not open;  otherwise, true. 

:  wi_home - set position to home

  procedure  wi_home (window_number : integer);

  Input	arguments:

       window_number - Window identification number

  Output arguments:

       None

  Action:

       Window position is set to home: window column 1,	row 1.
  
  Status:

       wi_status -  False  if  window  is not open; otherwise,
	 true. 

:  wi_border - set window border

  procedure  wi_border (window_number :	integer,
			 border_chars :	string[4]);

  Input	arguments:

       window_number - Window identification number

       border_chars - Window border character string

  Output arguments:

       None

  Action:

       If window is open and a window border was selected when
       the window was created, the border_chars	window border
       is stored in the	window control block. 

  Status:

       wi_status  -  False  if	window is not open or was  not
	 opened	with window border selected; otherwise,	true. 

:  wi_setpos - set position

  procedure  wi_setpos (window_number,
			 window_column,
			 window_row : integer);

  Input	arguments:

       window_number - Window identification number

       window_column - Window column number

       window_row - Window row number

  Output arguments:

       None

  Action:

       If the window is	open and if window_column and
       window_row are in range,	window position	is set to
       window_column and window_row.

  Status:

       wi_status - False if window  is	not open or window_row
	 or window_column are out of range; otherwise, true. 

:  wi_getpos - get position

  procedure  wi_getpos (window_number,
			 var window_column,
			     window_row	: integer);

  Input	arguments:

       window_number - Window identification number

  Output arguments:

       window_column - Window column number

       window_row - Window row number

  Action:

       If the window is	open, the current window position
       column and row values are returned in window_column and
       window_row. Note	that window_column and window_row may
       point to	end of window: one row greater than the	last
       accessible window row. 

  Status:

       wi_status - False if window  is	not open or window_row
	 or window_column are out of range; otherwise, true. 

:  wi_setorg - set origin

  procedure  wi_setorg (window_number,
			 screen_column,
			 screen_row : integer);

  Input	arguments:

       window_number - Window identification number

       screen_column - Screen column number

       screen_row - Screen row number

  Output arguments:

       None

  Action:

       If window is open and screen_column and screen_row are
       valid, the window origin	column and origin row are set
       to screen_column	and screen_row,	respectively. 

  Status:

       wi_status - False if window is not  open	 or screen_row
	 or screen_column are not in range; otherwise, true. 

:  wi_getorg - get origin

  procedure  wi_getorg (window_number,
			 var screen_column,
			     screen_row	: integer);

  Input	arguments:

       window_number - Window identification number

  Output arguments:

       screen_column - Screen column number

       screen_row - Screen row number

  Action:

       If the window is	open, the current window origin	column
       and origin row values are returned in screen_ column
       and screen_row, respectively. 

  Status:

       wi_status  - False if window is	not  open;  otherwise, true. 

:  wi_put - store character string

  procedure  wi_put (window_number : integer;
		      output_string : string[80]);

  Input	arguments:

       window_number - Window identification number

       output_string - Output character	string

  Output arguments:

       None

  Action:

       If the window is	open, output_string is stored in the
       window content array at the current window position. 
       As many characters as fit on the	current	window row up
       to the length of	output_string are stored; remaining
       characters are ignored.	wi_eoln	is set to true
       whenever	window position	is advanced past end of	row. 
       wi_eow is set to	true whenever window position is
       advanced	to end of window. 

       If at entry, window position is at end of window, the
       window is scrolled by deleting the first	row, shifting
       the remaining rows up one row, and storing blanks into
       the bottom row.	Window position	is set to the first
       column of the bottom row. 

       At exit,	window position	is set to the next character
       within the window following the last character of the
       output string.  When the	last character of the output
       string is the last column in the	row, window position
       is set to the first column of the next row and wi_eoln
       is set to true.	wi_eow is set to true when the next
       row is greater than the maximum number of accessible
       rows in the window. 

  Status:

       wi_status  -  False  if window is not open;  otherwise, true. 

       wi_eoln	-  True	 if  end of row	is  encountered	 while
	 storing output_string;	otherwise, true. 

       wi_eow -	 True if window	position is advanced to	end of
	 window; otherwise, false. 

:  wi_putln - store character string

  procedure  wi_putln (window_number : integer;
			output_string :	string[80]);

  Input	arguments:

	       window_number - Window identification number

	       output_string - Output character	string

  Output arguments:

       None

  Action:

       If the window is	open, output_string is stored in the
       window content array at the current window position. 
       As many characters as fit on the	current	window row up
       to the length of	output_string are stored; remaining
       characters are ignored. 

       If at entry, window position is at end of window, the
       window is scrolled by deleting the first	row, shifting
       the remaining rows up one row, and storing blanks into
       the bottom row.	Window position	is set to the first
       column of the bottom row. 

       At exit,	window position	is set to the beginning	of the
       next window row.	 wi_eoln is set	to true.  wi_eow is
       set to true if next row is beyond the last accessible
       row in the window. 

  Status:

       wi_status  - False if window is	not  open;  otherwise,
 true. 

       wi_eoln - True

       wi_eow -	True if	 window	position is advanced to	end of
	  window; otherwise, false. 

:  wi_get - retrieve character string

  procedure  wi_get (window_number,
		      input_length : integer;
		      var input_string : string[80]);

  Input	arguments:

       window_number - Window identification number

       input_length - Input string maximum length

  Output arguments:

       input_string - Input character string

  Action:

       If the window is	open, an input_string of length
       input_length is retrieved from the window content array
       beginning at the	current	window position.  If end of
       row is encountered before retrieving input_length
       characters, input_string	is truncated. 

       wi_eoln is set to true whenever window position is
       advanced	past end of row.  wi_eow is set	to true
       whenever	window position	is advanced to end of window. 

       At exit,	window position	is set to the next character
       within the window following the last character of the
       output string.  When the	last character of the output
       string is the last column in the	row, window position
       is set to the first column of the next row and wi_eoln
       is set to true.	wi_eow is set to true when the next
       row is greater than the maximum number of accessible
       rows in the window. 

  Status:

       wi_status - False if window is not open or if at	 entry
	  window  position is  at  end	of  window;  otherwise,	true. 

       wi_eoln	- True if end  of  row	is  encountered	 while
	  retrieving input_string; otherwise, false. 

       wi_eow -	True if	 window	position is advanced to	end of
	  window; otherwise, false. 

:  wi_getln - retrieve character string

  procedure  wi_getln (window_number,
			input_length : integer;
			var input_string : string[80]);

  Input	arguments:

       window_number - Window identification number

       input_length - Input string maximum length

  Output arguments:

       input_string - Input character string

  Action:

       This service is similar to wi_get, differing only in
       the manner of setting window position at	end of
       retrieval. 

       If the window is	open, an input string of length
       input_length is retrieved from the window content array
       beginning at the	current	window position.  If end of
       row is encountered before retrieving input_length
       characters, input_string	is truncated. 

       At exit,	window position	is set to the beginning	of the
       next window row.	 wi_eoln is set	to true.  wi_eow is
       set to true when	next row is beyond the last accessible
       row in the window. 

  Status:

       wi_status -  False if window is not open	or if at entry
	  window  position  is	at  end	of  window;  otherwise,
	  true.	

       wi_eoln - True

       wi_eow -	True if	window position	is advanced to end  of
	  window; otherwise, false. 

:  wi_write - write character string through window

  procedure  wi_write (window_number : integer;
			output_string :	string[80]);

  Input	arguments:

       window_number - Window identification number

       output_string - Output character	string

  Output arguments:

       None

  Action:

       If the window is	open, output_string is stored in the
       window content array at the current window position and
       written to the terminal display screen. 

       As many characters as fit on the	current	window row up
       to the length of	output_length are stored; remaining
       characters are ignored.	The beginning position of
       output_string on	the terminal display screen is window
       position	plus screen origin minus one for each
       dimension.  When	the computed screen position for a
       character falls outside the boundaries of the display
       screen, the character is	not displayed. 

       If at entry, window position is at end of window, the
       window is scrolled by deleting the first	row, shifting
       the remaining rows up one row, and storing blanks into
       the bottom row.	Window position	is set to the first
       column of the bottom row. 

       At exit,	window position	is set to the next character
       within the window following the last character of the
       output string.  When the	last character of the output
       string is the last column in the	row, window position
       is set to the first column of the next row and wi_eoln
       is set to true.	wi_eow is set to true when the next
       row is greater than the maximum number of accessible
       rows in the window. 

  Status:

       wi_status  -  False  if window is not open;  otherwise, true. 

       wi_eoln	-  True	 if  end  of row is encountered	 while
	  storing output_string; otherwise, false. 

       wi_eow -	True if	window position	is advanced to end  of
	   window; otherwise, false. 

:  wi_writeln -	write character	string through window

  procedure  wi_writeln	(window_number : integer;
			  output_string	: string[80]);

  Input	arguments:

       window_number - Window identification number

       output_string - Output character	string

  Output arguments:

       None

  Action:

       This service is similar to wi_out, differing only in
       the manner of setting window position at	end of
       output. 

       If the window is	open, output_string is stored in the
       window content array at the current window position and
       written to the terminal display screen. 

       As many characters as fit on the	current	window row up
       to the length of	output_length are stored; remaining
       characters are ignored.	The beginning position of
       output_string on	the terminal display screen is window
       position	plus screen origin minus one for each
       dimension.  When	the computed screen position for a
       character falls outside the boundaries of the display
       screen, the character is	not displayed. 

       If at entry, window position is at end of window, the
       window is scrolled by deleting the first	row, shifting
       the remaining rows up one row, and storing blanks into
       the bottom row.	Window position	is set to the first
       column of the bottom row. 

       At exit,	window position	is set to the beginning	of the
       next window row.	 wi_eoln is set	to true.  wi_eow is
       set to true when	next row is beyond the last accessible
       row in the window. 

  Status:

       wi_status  -  False  if window is not open;  otherwise,
 true. 

       wi_eoln - True

       wi_eow -	True if	window position	is advanced to end  of
	  window; otherwise, false. 

:  wi_read - read character string through window

  procedure  wi_read (window_number,
		      input_length : integer;
		      var input_string : string[80]);

  Input	arguments:

       window_number - Window identification number

       input_length - Input string maximum length

  Output arguments:

       input_string - Input character string

  Action:

       If the window is	open, window position is not at	end of
       window, and the window origin values permit the window
       to be displayed on the terminal screen, a character
       string of input_length characters is read from the
       keyboard, stored	in the window content array, and
       returned	in input_string.

       Character string	input is read character	by character
       until terminated	by a carriage return.  The service
       will not	accept input, other than a return, past	end of
       line or end of string.  The delete and backspace	keys
       may be used to delete previously	keyed string
       characters.  It is not possible to delete past
       beginning of string. 

       At exit,	window position	is set to the next character
       within the window following the last character of the
       input string.  When the last character of the input
       string is the last column in the	row, window position
       is set to the first column of the next row and wi_eoln
       is set to true.	wi_eow is set to true when the next
       row is greater than the maximum number of accessible
       rows in the window. 

  Status:

       wi_status - False if window is not open or if at	 entry
	  window  position  is	at  end	 of window;  otherwise,	true. 

       wi_eoln	-  True	 if end	of row	is  encountered	 while
	  storing input_string;	otherwise, false. 
 
       wi_eow -	 True if window	position is advanced to	end of
	  window; otherwise, false. 

:  wi_readln - read character string through window

  procedure  wi_readln (window_number,
			 input_length :	integer;
			 var input_string : string[80]);

  Input	arguments:

       window_number - Window identification number

       input_length - Input string maximum length

  Output arguments:

       input_string - Input character string

  Action:

       This service is similar to wi_read, differing only in
       the manner of setting window position at	end of read. 

       If the window is	open, window position is not at	end of
       window, and the window origin values permit the window
       to be displayed on the terminal screen, a character
       string of input_length characters is read from the
       keyboard, stored	in the window content array, and
       returned	in input_string.

       Character string	input is read character	by character
       until terminated	by a carriage return.  The service
       will not	accept input, other than a return, past	end of
       line or end of string.  The delete and backspace	keys
       may be used to delete previously	keyed string
       characters.  It is not possible to delete past
       beginning of string. 

       At exit,	window position	is set to the first character
       of the row following the	row containing the input
       string.	wi_eoln	is set to true.	 wi_eow	is set to true
       when the	next row is greater than the maximum number of
       accessible rows in the window. 

  Status:

       wi_status - False if window is not open	or if at entry
	  window  position  is	at  end	 of window;  otherwise,	true. 

       wi_eoln	-  True	 if  end of row	is  encountered	 while
	   storing input_string; otherwise, false. 

       wi_eow -	True if	window position	 is  advance to	end of
	  window; otherwise, false. 

:  wi_show - display window on screen

  procedure  wi_show (window_number : integer);

  Input	arguments:

       window_number - Window identification number

  Output arguments:

       None

  Action:

       If the window is	open, the service attempts to display
       the window contents on the terminal screen.  However,
       since it	is possible to set the window origin column
       and row such that the window is completely outside of
       the terminal display screen boundaries, this service
       may have	no visible effect. 

  Status:

       wi_status - False if  window  is	 not  open; otherwise, true. 

:  wi_erase - erase window area	on screen

  procedure  wi_erase (window_number : integer);

  Input	arguments:

       window_number - Window identification number

  Output arguments:

       None

  Action:

       If the window is	open, that portion of the terminal
       screen onto which the window maps is set	to spaces. 
       Since it	is possible to set the window origin row and
       column such that	the window is completely outside of
       the terminal display screen boundaries, this service
       may have	no visible effect. 

  Status:

       wi_status - False if  window  is	 not  open; otherwise, true. 

