
(********************************************************************)
(*                                                                  *)
(*  multiscr.s7i  Demonstration for several file filters            *)
(*  Copyright (C) 1992, 1993, 1994, 2005  Thomas Mertes             *)
(*                                                                  *)
(*  This file is part of the Seed7 Runtime Library.                 *)
(*                                                                  *)
(*  The Seed7 Runtime Library is free software; you can             *)
(*  redistribute it and/or modify it under the terms of the GNU     *)
(*  Lesser General Public License as published by the Free Software *)
(*  Foundation; either version 2.1 of the License, or (at your      *)
(*  option) any later version.                                      *)
(*                                                                  *)
(*  The Seed7 Runtime Library is distributed in the hope that it    *)
(*  will be useful, but WITHOUT ANY WARRANTY; without even the      *)
(*  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR *)
(*  PURPOSE.  See the GNU Lesser General Public License for more    *)
(*  details.                                                        *)
(*                                                                  *)
(*  You should have received a copy of the GNU Lesser General       *)
(*  Public License along with this program; if not, write to the    *)
(*  Free Software Foundation, Inc., 51 Franklin Street,             *)
(*  Fifth Floor, Boston, MA  02110-1301, USA.                       *)
(*                                                                  *)
(********************************************************************)


include "echo.s7i";
include "keybd.s7i";
include "line.s7i";
include "console.s7i";
include "window.s7i";
include "tee.s7i";
(* include "reverse.s7i"; *)
(* include "upper.s7i"; *)
(* include "lower.s7i"; *)
(* include "queue.s7i"; *)
(* include "more.s7i"; *)

var file: SCR is STD_NULL;
var file: OUT1 is STD_NULL;
var file: OUT2 is STD_NULL;
var file: OUT3 is STD_NULL;

const proc: INIT_MULTI is func
  begin
    SCR := open(CONSOLE);
    OUT := openWindow(SCR, 2, 2, 10, 78);
    OUT1 := openWindow(SCR, 14, 30, 10, 50);
    OUT2 := openWindow(SCR, 18, 2, 6, 25);
    OUT3 := openWindow(SCR, 14, 2, 2, 25);
    box(OUT);
    box(OUT1);
    box(OUT2);
    box(OUT3);
    OUT := openTee(OUT, OUT1);
    write(OUT3, "Input? ");
    IN := open(getln(IN), "r");
    if IN = STD_NULL then
      IN := KEYBOARD;
    end if;
    IN := openEcho(IN, openTee(OUT1, OUT2));
    IN := openLine(IN);
    clear(OUT3);
    write(OUT3, " MULTI SCREEN");
  end func;
