c++.dos.32-bits - Clear screen
- qwertier9023 (4/4) Aug 26 2001 hi
-
Walter
(4/8)
Aug 26 2001
#include
-
Kenneth Roger
(14/15)
Oct 29 2001
#include
- Jan Knepper (5/20) Oct 29 2001 You could rewrite this with
- Roland (4/19) Oct 30 2001 doesn't it work like that ?
- Walter (4/19) Oct 30 2001 www.digitalmars.com/faq.html#clrscr
- Kenneth Roger (17/18) Oct 29 2001 The console window peepers can do it this way.
- Vincent (11/11) Nov 13 2013 how can I clear the screen for example I input first letter (A)
- Heinz Saathoff (29/40) Nov 21 2013 Hello,
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
#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
--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.h.ah=0x2; reg.x.dx=0; reg.h.bh=0; int86(0x10,®,®); }
Oct 29 2001
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.h.ah=0x2; reg.x.dx=0; reg.h.bh=0; int86(0x10,®,®); }
Oct 29 2001
Kenneth Roger a écrit :doesn't it work like that ? may be you just have to replace int86 by int86_real Roland--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.h.ah=0x2; reg.x.dx=0; reg.h.bh=0; int86(0x10,®,®); }
Oct 30 2001
www.digitalmars.com/faq.html#clrscr "Kenneth Roger" <kennethroger prodigy.net> wrote in message news:9rk756$r8h$1 digitaldaemon.com...Mars?--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.h.ah=0x2; reg.x.dx=0; reg.h.bh=0; int86(0x10,®,®); }
Oct 30 2001
--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
how can I clear the screen for example I input first letter (A) and second letter (B) and show the result AB then after pressing enter it will clear the screen before it display again the Input first letter Input first letter : A Input second letter: B result: AB Input first letter: _ it should not be displaying the previous output like this... After showing the result it should be cleared the previous output before it shows the input first letter again...
Nov 13 2013
Hello, On Wed, 13 Nov 2013 19:05:50 +0100, "Vincent" <spawn_rock2000 yahoo.com> wrote:how can I clear the screen for example I input first letter (A) and second letter (B) and show the result AB then after pressing enter it will clear the screen before it display again the Input first letter Input first letter : A Input second letter: B result: AB Input first letter: _ it should not be displaying the previous output like this... After showing the result it should be cleared the previous output before it shows the input first letter again...You can use the display routines as declared in DISP.H The code can be like this: #include <disp.h> #include <conio.h> int main() { char a, b; disp_open(); // Init package do { disp_move(0,0); // top of screen disp_eeop(); // erase to end of page disp_puts("Input first letter :"); disp_flush(); a = _getche(); // read char with echo disp_puts("\nInput second letter :"); disp_flush(); b = _getche(); disp_printf("\nresult: %c%c\n", a, b); disp_puts("Press any key to repeat"); disp_flush(); _getch(); // wait so that result can be seen }while(a != ' '); disp_close(); return 0; }//main - Heinz
Nov 21 2013