On Tue, Jun 14, 2022 at 5:42 PM Zbigniew <zbigniew2...@gmail.com> wrote:
>
> > Do you want to do this as part of a program you are writing (such as
> > conio?)
>
> Indeed, I was pondering is it available as some (at the moment still
> unknown to me) interrupt/function.
>


I think this TESTWIN.C program demonstrates what you are looking for.
Use OpenWatcom (WCL TESTWIN.C) to compile this:


#include <stdio.h>
#include <conio.h>
#include <graph.h>

void
pause()
{
  if (getch() == 0) {
    getch();                           /* clear extended key */
  }
}

int
main()
{
  int repeat, letter;

  if (_setvideomode(_TEXTC80) == 0) {
    return 1;                          /* cannot set video mode */
  }

  /* screen coords are row,col */

  _settextwindow(5, 35, 15, 45);
  _settextcolor(15);                   /* br white */
  _setbkcolor(1);                      /* blue */
  _clearscreen(_GWINDOW);

  /* add a bunch of characters (demo) */

  for (repeat = 0; repeat < 10; repeat++) {
    _outtext("test1234");
  }

  pause();
  _settextcolor(14);                   /* yellow */

  for (repeat = 0; repeat < 10; repeat++) {
    _outtext("test1234");
  }

  pause();
  _setvideomode(_DEFAULTMODE);
  return 0;
}




What this does:

1. Sets a text window from row5, col35 to row15, col45 and clears it
with a blue background (so you can see the text window)

2. Fills part of the text window with several repetitions of
"test1234" in bright white

3. Waits for you to press a key (no prompt)

4. Adds more repetitions of "test1234" in yellow

5. Waits for you to press a key (no prompt)

6. Exits


Notice that the text inside the window will scroll inside the window.


_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to