Re: Does this string processing work for you?
- From: "David Frank" <dave_frank@xxxxxxxxxxx>
- Date: Thu, 29 Sep 2005 13:33:05 GMT
"Arjen Markus" <arjen.markus@xxxxxxxxxx> wrote in message
news:1127994635.662422.247740@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> But what happens with a loop like:
>
> read( s, *, err=1 ) ( v(i) ,i=7,100,3 )
>
> (By the way the final value of "i" with the Intel Fortran compiler
> on Linux is 103)
>
> Regards,
>
> Arjen
>
ok, below is closer to your request..
! -------------------
program process_string
character(200) :: s =
'1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35'
integer :: v(100), n
s(len_trim(s)+1:) = ' ' // char(0)
read (s,*,err=1) (v(n),n=7,size(v),3)
1 write (*,'(999I3)') n, v(7:n-3:3)
end program
103 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32
.
- Follow-Ups:
- Re: Does this string processing work for you?
- From: Arjen Markus
- Re: Does this string processing work for you?
- References:
- Does this string processing work for you?
- From: David Frank
- Re: Does this string processing work for you?
- From: Herman D . Knoble
- Re: Does this string processing work for you?
- From: David Frank
- Re: Does this string processing work for you?
- From: Arjen Markus
- Re: Does this string processing work for you?
- From: David Frank
- Re: Does this string processing work for you?
- From: Dan Nagle
- Re: Does this string processing work for you?
- From: David Frank
- Re: Does this string processing work for you?
- From: Arjen Markus
- Does this string processing work for you?
- Prev by Date: Re: NEWBIE QUESTION
- Next by Date: Re: Can Fortran Use This C Variable Directly Via "external" Decl?
- Previous by thread: Re: Does this string processing work for you?
- Next by thread: Re: Does this string processing work for you?
- Index(es):
Relevant Pages
|