www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/21/17:14:40

Message-Id: <199912211821.UAA07331@www.Foo.COM>
From: "S. M. Halloran" <mitch AT duzen DOT com DOT tr>
Organization: User RFC 822- and 1123-compliant
To: "Joanna Baldacci" <jbaldacci AT dial DOT pipex DOT com>
Date: Tue, 21 Dec 1999 20:29:04 +0200
MIME-Version: 1.0
Subject: Re: What's the symbol for 'return' in djgpp/dos
CC: djgpp AT delorie DOT com
In-reply-to: <83nsuk$bpr$1@lure.pipex.net>
X-mailer: Pegasus Mail for Win32 (v3.12b)
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 21 Dec 99, Joanna Baldacci was found to have commented thusly:

> sorry for my ignorance, but '\n' and '\0' don't seem to work. I also tried
> '^p', which someone told me was the answer. Any replies welcome. All I want
> to do is to use it to end some input. The symol for the 'esc' key would be
> just as handy.

The keyword 'return' is not used to stop input processing, but rather to 
return from a called function, specifying its value if the function 
returns some sort of value.

If you want to halt input processing, you need to make a call to the 
appropriate stdio family of functions which control input, each of which 
have different conditions for returning from their calls, effectively 
ending the input, and returning it to the calling function.  You will want 
to read about the details of the input functions:  fgetc() gets a charater 
from any file/stream; getchar() gets a character from the file/stream 
known as standard input; fgets() collects a sequence of characters from a 
file/stream into an array you specify, either up to the limit of the size 
of the array which you specify or when next input character is a '\n', 
whichever comes first; fread() reads from a stream of a number of data 
blocks/objects, both the number and size of blocks/objects which you 
specify, into an array you pass to it.  Other functions include 
(f)scanf().  These are probably the most useful and portable functions you 
can use, and you will want to become familiar with their details.

The response to input control characters varies with different systems 
where standards are not defined for them.  Trying Ctrl-C on program 
developed with DJGPP will certainly end your input.

> thanks
> 
> joanna


Mitch Halloran
Research (Bio)chemist
Duzen Laboratories Group
Ankara       TURKEY

- Raw text -


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