Thread overview | |||||
---|---|---|---|---|---|
|
December 29, 2004 readln() - how to detect EOF vs. a blank line? | ||||
---|---|---|---|---|
| ||||
Using the stand-alone version of dscript, how do you tell when there is no more standard input, as in: ds foo.js <file.txt Thanks! |
January 01, 2005 Re: readln() - how to detect EOF vs. a blank line? | ||||
---|---|---|---|---|
| ||||
Posted in reply to ed_davis2 at yahoo.com | "ed_davis2 at yahoo.com" <ed_davis2_member@pathlink.com> wrote in message news:cqv0he$1f2e$1@digitaldaemon.com... > Using the stand-alone version of dscript, how do you tell when there is no more > standard input, as in: > > ds foo.js <file.txt There currently isn't a way. I should probably fix that! |
July 22, 2005 Re: readln() - how to detect EOF vs. a blank line? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <newshound@digitalmars.com> wrote in message news:cr6o46$bfu$1@digitaldaemon.com... > Greetings, > "ed_davis2 at yahoo.com" <ed_davis2_member@pathlink.com> wrote in message news:cqv0he$1f2e$1@digitaldaemon.com... > > > > Using the stand-alone version of dscript, how do you tell > when there is no more > > standard input, as in: > > > > ds foo.js <file.txt > > There currently isn't a way. I should probably fix that! > I recently had a look at DMDScript 1.06 [standalone version] and noticed that this situation still exists. Would it be possible to remedy this for the next release ? For example, might it not be useful to return 'null' on EOF, thus allowing this sort of construct: var line = readln(); while (line != null) { ... line = readln(); } It would certainly enhance the utility of what appears to be quite a fine product. Cheers, Anthony Borla |
Copyright © 1999-2021 by the D Language Foundation