How to resolve the algorithm Terminal control/Dimensions step by step in the Seed7 programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Terminal control/Dimensions step by step in the Seed7 programming language

Table of Contents

Problem Statement

Determine the height and width of the terminal, and store this information into variables for subsequent use.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Terminal control/Dimensions step by step in the Seed7 programming language

Source code in the seed7 programming language

$ include "seed7_05.s7i";
  include "console.s7i";

const proc: main is func
  local
    var text: console is STD_NULL;
  begin
    console := open(CONSOLE);
    writeln(console, "height: " <& height(console) lpad 3);
    writeln(console, "width:  " <& width(console) lpad 3);
    # Terminal windows often restore the previous
    # content, when a program is terminated. Therefore
    # the program waits until Return/Enter is pressed.
    readln;
  end func;

  

You may also check:How to resolve the algorithm Create a two-dimensional array at runtime step by step in the Frink programming language
You may also check:How to resolve the algorithm Doubly-linked list/Traversal step by step in the Scala programming language
You may also check:How to resolve the algorithm Input loop step by step in the Go programming language
You may also check:How to resolve the algorithm Power set step by step in the Racket programming language
You may also check:How to resolve the algorithm Angles (geometric), normalization and conversion step by step in the C programming language