how to get line number after readln

Robert Hathaway via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 4 17:05:19 PDT 2014


I've got a program that reads a text file line by line (using 
std.stdio readln()) and I'd like to refer to the line number when 
I send a message to stderr upon finding a mis-formatted line.  Is 
there a way to get the current line number?  Of course, I could 
create a counter and increment it with each call to readln, but 
is there a "cool" way of doing this?

Okay, call me lazy... just don't call me late for dinner! :-)

Robert


More information about the Digitalmars-d-learn mailing list