Re: Does this string processing work for you?




"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


.



Relevant Pages

  • Re: Does this string processing work for you?
    ... > But what happens with a loop like: ... > (By the way the final value of "i" with the Intel Fortran compiler ... > on Linux is 103) ... HAVE to spread the items into the receiving array ...
    (comp.lang.fortran)
  • Re: spawning processes
    ... I've made something similar to you, using MPI on linux. ... It was a loop ... Prev by Date: ...
    (comp.lang.fortran)
  • Re: Does this string processing work for you?
    ... But what happens with a loop like: ... (By the way the final value of "i" with the Intel Fortran compiler ... on Linux is 103) ... Regards, ...
    (comp.lang.fortran)
  • ifort to detect undefined variables?
    ... I'm quite annoied that the intel fortran compiler on linux I'm using can not ... Anyone can tell me what's the paramter to enable undefined variables ... Prev by Date: ...
    (comp.lang.fortran)
  • Re: Windows XP startup question
    ... Yes, way to go in Linux, ... product is old enough to need a new CPU, the product feature set is ... I use PowerBasic for engineering apps. ... did the same loop in PB, the obvious way ...
    (sci.electronics.design)