Re: Is there any problem with the following program?
- From: Tim Prince <timothyprince@xxxxxxxxxxxxx>
- Date: Sat, 30 Dec 2006 03:23:58 GMT
zhngbn wrote:
I find the following program in a book:My guess is that the intent was
program ex0413
character(len=20) string
string = "Good morning."
write(*, *) string
string(6) = "evening."
write(*, *) string
end
When it is complied by CVF, the following error is displayed:
Error: This name has not been declared as an array. [STRING]
string(6) = "evening."
So, can anyone tell me what is the problem? Thanks a lot.
string(6:13) = "evening."
This looks suspiciously like a g77 program, and g77 will tell you
specifically about the missing colon.
CVF and its relatives are hinting that
character(len=20) string(6)
(an array of 6 strings of length 20)
would permit the usage string(6). Each of your write statements would
display all 6 strings.
.
- References:
- Is there any problem with the following program?
- From: zhngbn
- Is there any problem with the following program?
- Prev by Date: Re: Is there any problem with the following program?
- Next by Date: Re: Is there any problem with the following program?
- Previous by thread: Re: Is there any problem with the following program?
- Index(es):