delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/06/13:52:15

Message-ID: <38EC8AE7.AEA84CEF@corel.com>
Date: Thu, 06 Apr 2000 09:02:31 -0400
From: Jonathan Meunier <jonathanm AT corel DOT com>
X-Mailer: Mozilla 4.7 [en] (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: getch() with DJGPP in Win DOSbox
References: <38EC805F DOT A4614898 AT student DOT fontys DOT nl>
NNTP-Posting-Host: 120.150.3.42
X-Trace: 6 Apr 2000 09:03:06 -0500, 120.150.3.42
Lines: 19
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Were you afraid we wouldn't receive your post? Once suffices.. :)

Bart Verbakel wrote:
> 
> I am trying to create a loop like this:
> 
> while ( getch() != 'q' )
>   printf("Neverending textstring");
> 
> This is SUPPOSED to put the string to stdout,
> until I touch the 'q' key.

This is NOT supposed to print the text until 'q' is pressed. What this
does is wait for a key, looks if it's 'q'.. if it is then it exits the
loop, else it prints the text. What you are looking for is kbhit().. see
how it works in 'info libc kbhit'.

	.(Trancelucid).
	  .  Jaune  .

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019