Re: Is there any problem with the following program?



Beliavsky wrote:
zhngbn wrote:
I find the following program in a book:

program ex0413
character(len=20) string
string = "Good morning."
write(*, *) string
string(6) = "evening."

write instead

string(6:) = "evening."

(note the colon) and the program works.

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.

The variable "string" is NOT an array, so the CVF error message is
correct.


Can the OP tell us which book it was, so we can avoid buying it, or borrow it
from the library and laugh at it?

.



Relevant Pages

  • Help in French|Spanish|German translation.
    ... I am also an author of User-defined string functions. ... WORDTRANEX (cSearched, cArExpressionSought | cExpressionSough, ... each string of the array is searched ... If the parameter nArStartOccurrence is -1 or omitted, the replacement starts ...
    (microsoft.public.fox.helpwanted)
  • Re: passing a string to a dll
    ... Joe, I really appreciate you taking the time to demonstrate this. ... sure how I would implement indexing it for random alphanumeric codes. ... I might handle the array. ... I actually have been wondering if I could use a second string ...
    (microsoft.public.vc.mfc)
  • Re: passing a string to a dll
    ... I might handle the array. ... I actually have been wondering if I could use a second string ... look at insertion cost, organization cost, and search cost. ...
    (microsoft.public.vc.mfc)
  • RE: Structure conversion from C++ to VB-2008?
    ... One of the most important structures is AmiVar structure. ... point number, the array of floating point numbers, a string or IDispatch ... Dim 13012679 as Integer ...
    (microsoft.public.dotnet.languages.vb)
  • Structure conversion from C++ to VB-2008?
    ... One of the most important structures is AmiVar structure. ... point number, the array of floating point numbers, a string or IDispatch ... Dim 13012679 as Integer ...
    (microsoft.public.dotnet.languages.vb)