Hi - just learning FORTRAN, I want to print a line of '*', thought Id set up the line programmatically as follows:
character(len=n) :: stars
do cntr = 1, n
stars(cntr) = '*'
end do
However (I'm using silverleaf/plato) I get the following compile error "error 215 - Invalid expression on left hand side of assignment" - referring to the stars(cntr) = '*' line. It seems it doesn't like indexing the character string, but surely this is possible? Can anyone tell me how to achieve this with understanding?
Thanks
Ognik
character(len=n) :: stars
do cntr = 1, n
stars(cntr) = '*'
end do
However (I'm using silverleaf/plato) I get the following compile error "error 215 - Invalid expression on left hand side of assignment" - referring to the stars(cntr) = '*' line. It seems it doesn't like indexing the character string, but surely this is possible? Can anyone tell me how to achieve this with understanding?
Thanks
Ognik