Re: Character strings and arrays
- From: Ron Shepard <ron-shepard@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 24 Oct 2005 09:46:02 -0500
In article <3s3i0hFlua2fU1@xxxxxxxxxxxxxx>,
"Jugoslav Dujic" <jdujic@xxxxxxxxx> wrote:
> |
> | Given
> | real :: x
> | what is
> | x(1) ?
>
> A syntax error.
>
> However, as Giles pointed out, given character:: string, reference
> to string(1) is NOT a syntax error per se (without implicit none).
I still do not understand what you guys are talking about with
IMPLICIT NONE. The function type is declared explicitly, so
IMPLICIT NONE has no effect at all on the legality or the symantics.
function x(i)
real :: x
integer :: i
x = i*i
end function x
program xxx
implicit none
real :: x
write(*,*) x(1)
end program xxx
As far as I know, the above is a correct, legal, valid, program, and
it does not matter whether IMPLICIT NONE is included or not. If you
change the function to some character function,
function x(i)
character :: x
integer :: i
x = char(ichar('A')+i)
end function x
program xxx
implicit none
character :: x
write(*,*) x(1)
end program xxx
then I think it is still correct, legal, and valid either with or
without IMPLICIT NONE.
Since several posts have now been made with the idea that IMPLICIT
NONE changes the symantics, or makes something legal that would not
otherwise be legal (or visa versa), I conclude that there is simply
something that either my eye, or my compilers, is missing.
$.02 -Ron Shepard
.
- Follow-Ups:
- Re: Character strings and arrays
- From: James Giles
- Re: Character strings and arrays
- From: Richard E Maine
- Re: Character strings and arrays
- From: Jugoslav Dujic
- Re: Character strings and arrays
- From: Dan Nagle
- Re: Character strings and arrays
- References:
- '(*)' and List Directed I/O
- From: Ron Shepard
- Re: '(*)' and List Directed I/O
- From: Ken Plotkin
- Re: '(*)' and List Directed I/O
- From: Richard Maine
- Re: '(*)' and List Directed I/O
- From: Ken Plotkin
- Re: '(*)' and List Directed I/O
- From: Richard E Maine
- Re: '(*)' and List Directed I/O
- From: Jan Vorbrüggen
- Re: '(*)' and List Directed I/O
- From: John Harper
- Re: '(*)' and List Directed I/O
- From: Richard Maine
- Re: '(*)' and List Directed I/O
- From: James Giles
- re: Character strings and arrays
- From: robin
- Re: Character strings and arrays
- From: Dan Nagle
- Re: Character strings and arrays
- From: robin
- Re: Character strings and arrays
- From: Jugoslav Dujic
- '(*)' and List Directed I/O
- Prev by Date: Re: IMPLICIT NONE (F2k8+/-)
- Next by Date: Re: Character strings and arrays
- Previous by thread: Re: Character strings and arrays
- Next by thread: Re: Character strings and arrays
- Index(es):
Relevant Pages
|
|