From: Radical NetSurfer Newsgroups: comp.os.msdos.djgpp Subject: Re: printf, cprintf and CR/LF problem Date: Sun, 27 Aug 2000 06:49:11 -0400 Message-ID: References: X-Newsreader: Forte Agent 1.8/32.548 X-No-Archive: yes MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 216.202.134.183 X-Original-NNTP-Posting-Host: 216.202.134.183 X-Trace: 27 Aug 2000 06:52:08 -0400, 216.202.134.183 Lines: 49 X-Original-NNTP-Posting-Host: 64.31.79.51 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Specifically, my question addresses any time the LAST possible character position is written out on EACH line ( (c)printf, etc ), what you get is a NASTY blank line...which is not always welcomed; the problem is only compounded when the very LAST row is encountered and WHAMO! by-by the nicely formatted text that just happened to fill an entire 80x25 screen :( I have not experiemented with any of the ScreenUpdateXX()'s in DJGPP. Question: Are these anything like "dos_direct_screen_write" versions of the printf, etc ? if not, are there any such critters in existance; could they be easily mimiced otherwise ? When a direct-screen-write (d-s-w) type function writes a character (not a CR/LF) to the LAST possible screen location (lower-right-most-corner), I think it would be LEAST expected to cause a scroll. THAT scroll should not occur until the NEXT actual write occurs. Any opinions on this? What about producing an output routine that performs in this fasion, direct screen writes would be permissible PROVIDED they work in both true MS-DOS16 mode and under a Win31/9x DOS-SHELL/DOS7 modes. THANKS. On Sun, 27 Aug 2000 09:31:35 +0300 (IDT), Eli Zaretskii wrote: >On Sun, 27 Aug 2000, I wrote: > >> You could remove the \n from the format, and print it at the beginning of >> the next line instead. > >Sorry, it's possible that I didn't understand the problem correctly (a >code fragment would have helped). > >Are you saying that outputting a full 80-column line to the last screen >linhe position scrolls the entire display even if there's no \n in the >text you output? > >If so, then this is because both printf and cprintf (and also cputs and >cputc) always move the cursor past the last written character. On the >last line, moving the cursor will scroll the display. > >You need to write the characters in a way that doesn't involve moving the >cursor, like with ScreenUpdateLine or dosmemput.