realbasic-nug
[Top] [All Lists]

Re: Resetting stdin

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Resetting stdin
From: Charles Yeomans <charles at declareSub dot com>
Date: Wed, 29 Nov 2006 10:20:13 -0500
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <C1927692 dot 81620%ktekinay at mactechnologies dot com>

On Nov 28, 2006, at 11:28 PM, Kem Tekinay wrote:

My console app reads a bunch of text from stdin until stdin.EOF is true. It then does some processing before it needs to prompt the user for more stuff. The problem is, stdin.ReadLine no longer seems to do anything, returning a blank string without pausing. Is there a way to "reset" stdin so it will accept more text? Or is there another way to prompt the user to enter text?


I think that this is what the method Input is for.

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


From  Wed 29 Nov 2006 08:45:07 -0700
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
        id EFCC0126AFB8; Wed, 29 Nov 2006 07:45:41 -0800 (PST)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on www.realsoftware.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=4.5 tests=AWL,BAYES_00,NO_REAL_NAME autolearn=no version=3.1.1
Received: from lists.realsoftware.com (lists.realsoftware.com [209.198.132.125])
        by xmail.realsoftware.com (Postfix) with ESMTP id BB2A1126AFB2;
        Wed, 29 Nov 2006 07:45:35 -0800 (PST)
Received: from lists.realsoftware.com (localhost [127.0.0.1])
        by lists.realsoftware.com (Postfix) with ESMTP
        id 04C5416BC161; Wed, 29 Nov 2006 09:45:20 -0600 (CST)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from mail.verex.com (mail.verex.com [66.116.103.197])
        by lists.realsoftware.com (Postfix) with ESMTP id B84E216BC150
        for <realbasic-nug at lists dot realsoftware dot com>;
        Wed, 29 Nov 2006 09:45:09 -0600 (CST)
Received: from [66.116.103.197] (localhost [127.0.0.1])
        by mail.verex.com (Postfix) with SMTP id A81A06AA19B
        for <realbasic-nug at lists dot realsoftware dot com>;
        Wed, 29 Nov 2006 08:45:07 -0700 (MST)
Date: Wed, 29 Nov 2006 08:45:07 -0700
From: joe at strout dot net
To: realbasic-nug at lists dot realsoftware dot com
In-Reply-To: <808E82D5-43B8-4D3D-8DC7-503CB3AFA01B at declareSub dot com>
X-Mailer: VerEx Email Gateway
Content-type: text/plain;
Content-transfer-encoding: 7bit
Message-Id: <20061129154507 dot A81A06AA19B at mail dot verex dot com>
Subject: Re: Resetting stdin
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.2
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com

On Nov 29, 2006, at 15:20 UTC, Charles Yeomans wrote:

On Nov 28, 2006, at 11:28 PM, Kem Tekinay wrote:

> My console app reads a bunch of text from stdin until stdin.EOF is > true. It > then does some processing before it needs to prompt the user for > more stuff.

I think that this is what the method Input is for.

I think the method Input does the same thing as stdin.ReadLine.  But I
haven't actually tested it lately.

In the same vein, my understanding of Unix is that when you press
control-D to terminate console input (or equivalently, reach the end of
a file you've piped to stdin), then that's it, that stream is
permanently at EOF.  I've never seen a Unix app where you can terminate
input and then give more input later.  A more typical solution, I
think, is to terminate input with a blank line or a "." line or
something like that.

HTH,
- Joe

--
Joe Strout -- joe at strout dot net
Verified Express, LLC     "Making the Internet a Better Place"
http://www.verex.com/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>