Re: reading lines with trailing white spaces
- From: "Arjen Markus" <arjen.markus@xxxxxxxxxx>
- Date: 22 Feb 2007 23:25:54 -0800
Coming from a C,C++ background I have been told to avoid GOTO like hell.
But, I guess, it is more of a choice/style ...
No offense taken :) I checked my code (the textstream one), it
contains
a single goto in a routine of approximately 20 lines. I guess I could
have
used the value of an IOSTAT= variable (-2 indicates end-of-line) but I
was
probably too lazy to do it :).
Anyway:
Even in C gotos can be very useful, just as in Fortran: to avoid
cluttering
the source code that deals with the ordinary case with error handling
code
directly after the detection of the error. I have seen source code
that
aggressively tries to avoid that - as it was reading a file, after
every
read statement, several tens of them, you would see a check on
possible
I/O errors and if there was an error, the file would be closed and the
routine would return ... I leave the conclusion to you :)
Regards,
Arjen
.
- References:
- reading lines with trailing white spaces
- From: Kamaraju S Kusumanchi
- Re: reading lines with trailing white spaces
- From: Arjen Markus
- Re: reading lines with trailing white spaces
- From: Kamaraju S Kusumanchi
- Re: reading lines with trailing white spaces
- From: Arjen Markus
- Re: reading lines with trailing white spaces
- From: Kamaraju S Kusumanchi
- reading lines with trailing white spaces
- Prev by Date: Re: Variable number of arguments
- Next by Date: Re: Variable number of arguments
- Previous by thread: Re: reading lines with trailing white spaces
- Next by thread: RE: reading lines with trailing white spaces
- Index(es):