Re: D Snippet: Reading a file to standard output on Windows Operating System. (FileScan.d)

2023-12-09 Thread BoQsc via Digitalmars-d-learn
`switch` statement to match a text line While outputing to the standard stream, it is also possible to use `switch` statement to **match a text line to a text line in a file.** I personally think it improve readability and maintainability in some applications. ``` import std; void

Re: D Snippet: Reading a file to standard output on Windows Operating System. (FileScan.d)

2023-12-08 Thread BoQsc via Digitalmars-d-learn
On Wednesday, 6 December 2023 at 14:56:50 UTC, BoQsc wrote: As of recent observation the `line` in the previous implementation seem to recognise **\r** as default terminator. Making `writeln("|" ~ line ~ "|");` not possible. By correcting terminator and disabling it on `byLine` function it

Re: D Snippet: Reading a file to standard output on Windows Operating System. (FileScan.d)

2023-12-06 Thread BoQsc via Digitalmars-d-learn
As of recent observation the `line` in the previous implementation seem to recognise **\r** as default terminator. Making `writeln("|" ~ line ~ "|");` not possible. By correcting terminator and disabling it on `byLine` function it is possible to achieve following output to standard stream: