www.digitalmars.com         C & C++   DMDScript  

c++.dos.32-bits - Clear screen

reply "qwertier9023" <psonetwol hotmail.com> writes:
hi
I've noticed that other dos and win compilers have conio.h that contains
code for clear screen. _clrscr What is the equivalent for Digital Mars?
Thanks in advance
Aug 26 2001
next sibling parent "Walter" <walter digitalmars.com> writes:
#include <disp.h>

disp_move(0,0);
disp_eeop();

qwertier9023 wrote in message <9ma8nu$oc7$1 digitaldaemon.com>...
hi
I've noticed that other dos and win compilers have conio.h that contains
code for clear screen. _clrscr What is the equivalent for Digital Mars?
Thanks in advance

Aug 26 2001
prev sibling next sibling parent reply "Kenneth Roger" <kennethroger prodigy.net> writes:
 --code for clear screen. _clrscr What is the equivalent for Digital Mars?

#include <dos.h> void clrscr() { union REGS reg; reg.x.ax=0x0600; reg.h.bh=7; reg.x.cx=0; reg.x.dx=0x184F; int86(0x10,&reg,&reg); reg.h.ah=0x2; reg.x.dx=0; reg.h.bh=0; int86(0x10,&reg,&reg); }
Oct 29 2001
next sibling parent Jan Knepper <jan smartsoft.cc> writes:
You could rewrite this with
int86x/int86x_real and using REGS, REGS and SREGS...
Check bios.h and dos.h

Jan



Kenneth Roger wrote:

 --code for clear screen. _clrscr What is the equivalent for Digital Mars?

#include <dos.h> void clrscr() { union REGS reg; reg.x.ax=0x0600; reg.h.bh=7; reg.x.cx=0; reg.x.dx=0x184F; int86(0x10,&reg,&reg); reg.h.ah=0x2; reg.x.dx=0; reg.h.bh=0; int86(0x10,&reg,&reg); }

Oct 29 2001
prev sibling next sibling parent Roland <rv ronetech.com> writes:
Kenneth Roger a écrit :

 --code for clear screen. _clrscr What is the equivalent for Digital Mars?

#include <dos.h> void clrscr() { union REGS reg; reg.x.ax=0x0600; reg.h.bh=7; reg.x.cx=0; reg.x.dx=0x184F; int86(0x10,&reg,&reg); reg.h.ah=0x2; reg.x.dx=0; reg.h.bh=0; int86(0x10,&reg,&reg); }

doesn't it work like that ? may be you just have to replace int86 by int86_real Roland
Oct 30 2001
prev sibling parent "Walter" <walter digitalmars.com> writes:
www.digitalmars.com/faq.html#clrscr

"Kenneth Roger" <kennethroger prodigy.net> wrote in message
news:9rk756$r8h$1 digitaldaemon.com...
 --code for clear screen. _clrscr What is the equivalent for Digital


 #include <dos.h>
 void clrscr()
   {
   union REGS reg;
   reg.x.ax=0x0600;
   reg.h.bh=7;
   reg.x.cx=0;
   reg.x.dx=0x184F;
   int86(0x10,&reg,&reg);
   reg.h.ah=0x2;
   reg.x.dx=0;
   reg.h.bh=0;
   int86(0x10,&reg,&reg);
   }

Oct 30 2001
prev sibling parent "Kenneth Roger" <kennethroger prodigy.net> writes:
 --clear screen. _clrscr What is the equivalent for Digital Mars?

The console window peepers can do it this way. #include <windows.h> void clrscr() { HANDLE hout; DWORD nc, ncw; CONSOLE_SCREEN_BUFFER_INFO sbi; COORD home; home.X=home.Y=0; hout=GetStdHandle(STD_OUTPUT_HANDLE); if(hout==INVALID_HANDLE_VALUE) return; GetConsoleScreenBufferInfo(hout,&sbi); nc=sbi.dwSize.X*sbi.dwSize.Y; FillConsoleOutputAttribute(hout,sbi.wAttributes,nc,home,&ncw); FillConsoleOutputCharacter(hout,' ',nc,home,&ncw); SetConsoleCursorPosition(hout,home); }
Oct 29 2001