>>I find that the Sun F90 compiler flags the following as an error:
>>(WorkShop Compilers 5.0 98/12/21 FORTRAN 90 2.0)
>>
>> call report("First part of a particularly long error"// &
>> " message, continued onto a second line")
>>
>>and also this:
>>
>> call report("First part of a particularly long error" &
>> //" message, continued onto a second line")
>>
>>These are both legitimate, aren't they?
>
>I think, the standard F90 way to use the continuation symbol & for STRINGS
>is to put one at the end of first line, AND one at the beginning of the
>next line:
>
>call report("First part of a particularly long error"// &
> & " message, continued onto a second line")
Marcel,
I think this is true IFF the strings are not delimited by end-quotes or
end-double-quotes on the same line.
Since Anthony delimited the end of string, on the same line, I believe that he
only needs the end of line &. As with much in Fortran, particularly F90/F95, I
am always ready to be corrected. I was not too bad with FORTRAN :-)
I think the next bit was Phillip:
>>The following does work:
>>
>> call report("First part of a particularly long error &
>> &message, continued onto a second line")
This does need both ampersands because the string was not terminated on the
first line. Gets to be fun (i.e., almost obfuscated programming) when an
ampersand is part of the string.
Regards, Paddy
Paddy O'Brien,
System Planning,
TransGrid,
PO Box A1000, Sydney South,
NSW 2000, Australia
Tel: +61 2 9284-3063
Fax: +61 2 9284-3050
Email: [log in to unmask]
Either "\'" or "\s" (to escape the apostrophe) seems to work for most people,
but that little whizz-bang apostrophe gives me little spam.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|