yes it is! it is needed to concatenate char(13) which is carriage return and char(10) which is linefeed to the end of the line, as is the case for text files in MS Dos and Windows.
"writeln (or writenl) is not recognized by my compiler"
Notepad will not recognise a "unix" formatted file with just a linefeed character (char(10) as above) at the end of each line as a delimiter. Notepad being Microsoft expects to see a carriage return followed by a linefeed (char(13 and char(10)), to signify a new line.
If you use an editor like PFE32 it will recognise and distinguish between MS or unix text files , (displaying the file format in a box), I'm sure there are other editors that will do likewise.
Gfortran on cygwin means it has been ported from linux to run on windows, that's probably your problem. Try using the windows version of g95 instead, it works fine.
I only have a version of Fortran77 complier installed on my computer.
Now, I can say that you had an answer to the question and/or problem, but there was a file reading issue getting in the way -- you recognized what the issue was ...
In my opinion, with computer work, there is always something that gets in one's way no matter how simple and obvious the problem is -- there is always more to it than it should be ...
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Metal 3D printing has rapidly emerged as a key technology in modern design and manufacturing, so it’s critical educational institutions include it in their curricula to avoid leaving students at a disadvantage as they enter the workforce. Download Now
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now
RE: newline character doesnt work?
but not when i print in a file .dat or .txt
RE: newline character doesnt work?
CODE
write(50,'(A)') 'lastname'
RE: newline character doesnt work?
If I am not mistaken, it should work for you -- please check it out ...
http://www.engineering-4e.com
RE: newline character doesnt work?
The // is a concatenation operator
and writeln (or writenl) is not recognized by my compiler
RE: newline character doesnt work?
yes it is! it is needed to concatenate char(13) which is carriage return and char(10) which is linefeed to the end of the line, as is the case for text files in MS Dos and Windows.
"writeln (or writenl) is not recognized by my compiler"
because neither is Fortran !
What are you using to view the output file with??
RE: newline character doesnt work?
In my opinion, it should not be a difficult problem to solve, but it is.
My suggestion is to do a Google search and try to find a source for gfortran and its commands with some working examples ...
http://www.engineering-4e.com
RE: newline character doesnt work?
and the result remains the same
In all fortran manuals i see,
slash / begins a new line!!
RE: newline character doesnt work?
This is a Fortran forum, not a guess the answer quiz!
RE: newline character doesnt work?
CODE
write(6 ,FMT='(I3,/)') 111
WRITE(6 ,FMT='(I3,/)') 222
write(50,FMT='(I3,/)') 111
WRITE(50,FMT='(I3,/)') 222
close(50)
end
111
222
but in the dat file i see:
111222
RE: newline character doesnt work?
With what are you viewing the file "test.dat" ?
RE: newline character doesnt work?
- Steve
RE: newline character doesnt work?
RE: newline character doesnt work?
Notepad will not recognise a "unix" formatted file with just a linefeed character (char(10) as above) at the end of each line as a delimiter. Notepad being Microsoft expects to see a carriage return followed by a linefeed (char(13 and char(10)), to signify a new line.
If you use an editor like PFE32 it will recognise and distinguish between MS or unix text files , (displaying the file format in a box), I'm sure there are other editors that will do likewise.
Gfortran on cygwin means it has been ported from linux to run on windows, that's probably your problem. Try using the windows version of g95 instead, it works fine.
RE: newline character doesnt work?
RE: newline character doesnt work?
I only have a version of Fortran77 complier installed on my computer.
Now, I can say that you had an answer to the question and/or problem, but there was a file reading issue getting in the way -- you recognized what the issue was ...
In my opinion, with computer work, there is always something that gets in one's way no matter how simple and obvious the problem is -- there is always more to it than it should be ...
Thanks!
http://www.engineering-4e.com
RE: newline character doesnt work?
but since i dont want to use microsoft editor like MSword u mentioned..
Do u know an editor i can call with cygwin that will display the result correctly?
RE: newline character doesnt work?
http://w
RE: newline character doesnt work?
Thanx