Hi Rick --

I think you're right that this is not yet documented (and apologize for that). We're embarking on a project to move documentation of standard library routines to the web, so more recent library changes have sometimes gone undocumented, waiting for that capability to come online to avoid editing the libraries chapter of the language spec or the READMEs only to throw it away. I have a feeling that's what happened in this case.

-Brad


On Wed, 5 Nov 2014, Rick Burris wrote:

Readline does appear to capture the newline as well, but it gets the whole string, so I can work with that. I can't find mention of it in any documentation though. Am I missing it, or is that work in progress? 

Calling flush also works great. 

Thanks! 



<div>-------- Original message --------</div><div>From: Brad Chamberlain <[email protected]> </div><div>Date:11/04/2014  
7:07 PM  (GMT-07:00) </div><div>To: Rick Burris <[email protected]>,[email protected] 
</div><div>Subject: RE: Readln </div><div>
</div>Hi Rick --

I don't have time tonight to give you a thoroughly tested answer, but in hopes 
of getting some breadcrumbs back to you quickly:

* I think you want to use channel.readline(ref arg: string) to read a whole 
line up to the linefeed into a string

* I think the lack of flushing write() output to the console by default 
(assuming you're also not printing any linefeed characters) is intentional and 
consistent with typical (C-style) buffering of I/O.  I believe you can address 
it either by flushing  the channel after the write, or by turning buffering for 
the channel down/off.

-Brad


From: Rick Burris [[email protected]]
Sent: Tuesday, November 04, 2014 2:34 PM
To: [email protected]
Subject: Readln

I feel like this is a really dumb question, but I haven't yet been able to figure this out. How can I prompt for stdin input and have it read everything to the enter key? So far, I can only seem to manage everything up to the first whitespace. It seems to be the same on read and readln. In a related subject, I've noticed that I can use writeln followed by a read operation, but if I use write followed by read, it does not print the message until after the read. Is that normal?
(Linux Mint 17, Chapel 1.10.0)

Thank you, -Rick
------------------------------------------------------------------------------
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to