Are Continuation Lines Allowed in Fortran90
new line in fortran90
| Author | Message |
|---|---|
| Hi, i'm writing a small code (F90) intending to revise fortran programs in How to determine if the character is the last one in a line? In C, if '\n' is read, then we know that a new line will begin. What's it in Thanks | |
| Fri, 24 Oct 2003 21:24:23 GMT | |
| | |
| Not quite so easy...standard F77 line is col 1-5 : line number (or C in col 1 for comment) (was "D" standard or Many compilers had extensions that allowed longer source lines, however What did I forget? <G> Quote: > Hi, i'm writing a small code (F90) intending to revise fortran programs in > How to determine if the character is the last one in a line? > In C, if '\n' is read, then we know that a new line will begin. What's it in > Thanks | |
| Fri, 24 Oct 2003 23:55:58 GMT | |
| | |
| Thanks . ?? (where readStatus =0, successful or -1, EOF ) ******** Have you got any other methods for this? Thanks. Quote: > Not quite so easy...standard F77 line is > col 1-5 : line number (or C in col 1 for comment) (was "D" standard or > Many compilers had extensions that allowed longer source lines, however > What did I forget? <G> > > Hi, i'm writing a small code (F90) intending to revise fortran programs > > How to determine if the character is the last one in a line? > > In C, if '\n' is read, then we know that a new line will begin. What's > > Thanks | |
| Sat, 25 Oct 2003 02:37:25 GMT | |
| | |
| Quote: > so it's impossible to decide whether or not the end of a line is reached > ******** On the other hand, it seems like you are just making extra work A "normal" Fortran formatted read will naturally read a whole record. There are places where non-advancing input is useful. This doesn't But since your input is F77 source code, then trailing blanks So just read line at a time with something like read(lun,'(a)',...) line where line is a character string long enough to hold the longest The character line(1:1) will always be the first character in each Seems to me like this is a lot more straightforward than using -- | |
| Sat, 25 Oct 2003 02:45:33 GMT | |
| | |
| That's really GREAT. Quote: > > so it's impossible to decide whether or not the end of a line is > > ******** > It's quite possible. The direct analogue of the above C fgetc usage is > On the other hand, it seems like you are just making extra work > A "normal" Fortran formatted read will naturally read a whole record. > There are places where non-advancing input is useful. This doesn't > But since your input is F77 source code, then trailing blanks > So just read line at a time with something like > read(lun,'(a)',...) line > where line is a character string long enough to hold the longest > The character line(1:1) will always be the first character in each > Seems to me like this is a lot more straightforward than using > -- | |
| Sat, 25 Oct 2003 03:25:28 GMT | |
| | |
| No, in Fortran there is a \n at each source line in the source file, but I had intended to add this to my previous post, but got an itchy trigger There are several free utilities to convert from F77 fixed format files Quote: > Thanks . > ?? (where readStatus =0, successful or -1, EOF ) > ******** > Have you got any other methods for this? > Thanks. > > Not quite so easy...standard F77 line is > > col 1-5 : line number (or C in col 1 for comment) (was "D" standard or > > Many compilers had extensions that allowed longer source lines, however > > What did I forget? <G> > > > Hi, i'm writing a small code (F90) intending to revise fortran programs > > > How to determine if the character is the last one in a line? > > > In C, if '\n' is read, then we know that a new line will begin. What's > > > Thanks | |
| Sat, 25 Oct 2003 03:05:50 GMT | |
| | |
| Quote: hongxun lee writes: In Fortran 90, just use LEN_TRIM. | |
| Sat, 25 Oct 2003 05:20:06 GMT | |
| | |
| Sounds a bit like you're trying to write a source form converter. A source form convertor, convert.f90, is obtainable by ftp from Regards, Mike Metcalf -- | |
| Sat, 25 Oct 2003 15:30:31 GMT | |
| | |
| There are many ways. Second, a slash in FORMAT specifier means new line: Third, for writing, you can manually insert CHAR(13) (or CHAR(13)+CHAR(10)): Etc. Jugoslav | |
| Fri, 24 Oct 2003 23:41:57 GMT | |
| | |
| Quote: > Third, for writing, you can manually insert CHAR(13) (or CHAR(13)+CHAR(10)): This includes any system that doesn't use the ASCII character set (or It also includes systems that represent text records using counted -- | |
| Sat, 25 Oct 2003 22:49:44 GMT | |
Powered by phpBB® Forum Software
Source: http://computer-programming-forum.com/49-fortran/375b1abb784a1a89.htm
0 Response to "Are Continuation Lines Allowed in Fortran90"
Post a Comment