IK:
So indeed formattedRead() fails for a newline. Can this be
considered a bug?
Hara knows. Maybe it's a bug.
Bye,
bearophile
Now I see! The error message is a bit awkward, it should show
'\n' instead.
(It should also use Windows line endings on a Windows machine,
but that's a minor point.)
So indeed formattedRead() fails for a newline. Can this be
considered a bug?
This program below fails if the file contains an empty line.
Why exactly does this happen?
Does ln get a mangled value when a line is empty?
import std.format;
import std.stdio;
void main()
{
int[] test;
foreach (ln; File("ints.txt").byLine)
formatte
On 06/18/2012 05:11 PM, IK wrote:
Hmm does your code generate a 1D `array` as a grid, bearophile?
Anyway thanks, I'll compile it shortly.
My own code evolved to what's below and gives a Range violation.
Also I don't understand why formattedRead can't just accept a casted
`opSlice.dup`, is it a b
Hmm does your code generate a 1D `array` as a grid, bearophile?
Anyway thanks, I'll compile it shortly.
My own code evolved to what's below and gives a Range violation.
Also I don't understand why formattedRead can't just accept a casted
`opSlice.dup`, is it a bug?
void main()
{
uint[20][
IK:
Question: how to read that grid from a text file?
I don't know the cause of your problem. While investigating it I
have filed another bug:
http://d.puremagic.com/issues/show_bug.cgi?id=8260
In the meantime this (a bit scary) code solves your reading
problem:
import std.stdio, std.al
I'm attempting Project Euler's problem 11.
http://projecteuler.net/problem=11
Currently, my code looks like posted below, and it gives
object.Error: Access Violation
at runtime.
Question: how to read that grid from a text file? (See link above.)
If you have ideas for using something other tha