The string to be deciphered by the read must be 5*'abc' (total seven characters).
So you want the setting of variable "a" to be: a='5*''abc''' (if I got that right).
The free format (*) needs a way to distinguish insignificant blanks from the string to be read, so the quotes are needed.
-----Original Message-----
From: Fortran 90 List [mailto:[log in to unmask]]On Behalf
Of Jean Vezina
Sent: Friday, September 03, 2004 3:31 PM
To: [log in to unmask]
Subject: Is this program standard conforming (Fortran 95) ?
To all:
I have the following program that is rejected by
a compiler:
character*10 a
character*3 abc(5)
a = '5*abc'
read(a,*)abc
print *,abc
end
What causes the problem is the string 5*abc
Is it allowed to have a repeat count before
an undelimited character string ?
Thanks in advance,
Jean Vezina
-----------------------------------------
*****************Internet Email Confidentiality Footer******************
Privileged/Confidential Information may be contained in this message.
If you are not the addressee indicated in this message (or responsible
for delivery of the message to such person), you may not copy or deliver
this message to anyone. In such case, you should destroy this message
and notify the sender by reply email. Please advise immediately if you
or your employer do not consent to Internet email for messages of this
kind. Opinions, conclusions and other information in this message that
do not relate to the official business of The Shaw Group Inc. or its
subsidiaries shall be understood as neither given nor endorsed by it.
________________________________________________________________________
The Shaw Group Inc.
http://www.shawgrp.com
|