Re: Does this string processing work for you?



Dave: For your info.

Windows: Works with Salford FTN95, Lahey LF95

Windows: Many lines of garbage output from G95.

Lnux: Works with Intel ifort, Lahey lf95

Linux: many lines of garbage output from the following compilers:
pathscale pathf90, Portland pgf90, Absoft F95, IBM xlf90.

Exampes of "many lines of garbage output"

(From Absoft F95):
101 1 2 3 4 5 6 7*** 48********* 0***180*********180*********
3*********180************************************180********************* 3***
1********************* 1*********************************
1*************************************************** 1
0*********************************

(From PathScale pathf90):
101 1 2 3 4 5 6 7 0112 0*** 61*** 0*** 61 64 0*** 61*** 61*** 61 0 0 0 0 0
0*** 61*** 0 56 0-32 -1 79 0112 0*** 61*** 61*** 2 0 0*** 61 1 0 1 0*** 42***
61*** 0 55****** 0 56 0 0 0*** 0*** 61*** 61*** 61 1 0*** 0*** 61***127*********
0*** 42 0 0*** 0*** 42*** 42


Skip Knoble


On Tue, 27 Sep 2005 08:55:51 GMT, "David Frank" <dave_frank@xxxxxxxxxxx> wrote:

-|Below works on CVF because:
-|1. it terminates list input when it encounters a null char during the read.
-|2. it makes available the list index count on error exit
-|
-|So does below work on your non-CVF system?
-|If it does, it represents the simplest/shortest method yet shown to process
-|unknown integer items from file record.
-|
-|I posted below over in comp.lang.pl1 in rebuttal to some horrific PL/I
-|string-handling code thats currently being discussed and in reply to a
-|comp.lang.fortran regular, Glen Hermansfeldt's un-substantiated claim " PL/I
-|has better string-handling than Fortran"
-|
-|! -------------------
-|program process_string ! thats input from file record?
-|character(200) :: s = '1,2,3,4,5,6,7'
-|integer :: v(100), n
-|
-|s(len_trim(s)+1:) = ' ' // char(0) ! conv to cstring
-|
-|read (s,*,err=1) (v(n),n=1,size(v))
-|1 write (*,'(999i3)') n, v(1:n-1) ! = 8 1 2 3 4 5 6 7
-|end program
-|

.