Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

write "'" to an output file

Status
Not open for further replies.

thyme

Programmer
Jul 14, 2006
3
US
Is there a way to write "'" to an output file in fortran?
I tried this one:
write(10,*)'''
It gives the error:
write(10,*)'''
1 2
character constant at (1) has no closing apostrophe at (2)
 
Option 1) Enclose it in quotes i.e. "'"
Option 2) Use CHAR(34) - assuming that you are using ASCII and not EBCDIC
 
Also, the enigmatic:

write (10,*) ''''

will also work. Yes, that's four single-quotes in a row, which turns the stomachs of scripters everywhere, but hey. :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top