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!

Character input

Status
Not open for further replies.

bobo12

Programmer
Dec 26, 2004
74
US
i am puzzled, if only 1 char has been written to file NEWT, how can i read read 127 chars, won't all the values be ' '
assume FMAT is character*127 which holds a fortran-type format like 40F1.0, and FMAT1 is char[127]

OPEN (11,FILE='NEWT',STATUS='NEW')
WRITE (11,'(A)') FMAT
CLOSE (11)
OPEN (11,FILE='NEWT')
READ (11,5)(FMAT1(I), I = 1,127)
5 FORMAT (127A1)
CLOSE (11)

i guess my ? is, what are the values in FMAT1.
 
Null strings (two consecutive primes) are illegal. The remaining values will be spaces.
 
hi,
what do u mean when you say...
"Null strings (two consecutive primes) are illegal."
what piece of code are u referring to?
 
Code:
X = ''  ! compiler doesn't like this
X = ' ' ! this is OK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top