Re: compare two dynamic string
- From: "David Frank" <dave_frank@xxxxxxxxxxx>
- Date: Fri, 28 Oct 2005 11:38:38 GMT
"TC" <tecomeco@xxxxxxxxx> wrote in message
news:CNl8f.12360$65.343462@xxxxxxxxxxxxxxxxxxxxx
> Rich Townsend ha scritto:
>> TC wrote:
>>
>>> How compare two dynamic string?
> character,allocatable :: Parola (:)
> character,allocatable :: P (:)
>
> ??? if (Parola < P) then
> and = >
Ignore Rich when he tries to convince you to use his humonguous Varying
String module that cant do read/write ,
its not needed..
! ---------------------------------
program compare_dynamic_char_arrays
character,allocatable :: Parola (:)
character,allocatable :: P (:)
character(10) :: string1, string2 = '1234567890'
allocate ( Parola(10), P(10) )
P = transfer(string2, P) ! init char arrays as equal
Parola = P
if ( transfer(Parola,string1) < transfer(P,string2) ) then
write (*,*) 'Parola < P'
else
write (*,*) 'Parola <= P' ! is the output
end if
end program
.
- Follow-Ups:
- Re: compare two dynamic string
- From: Rich Townsend
- Re: compare two dynamic string
- From: Dan Nagle
- Re: compare two dynamic string
- From: beliavsky
- Re: compare two dynamic string
- References:
- compare two dynamic string
- From: TC
- Re: compare two dynamic string
- From: Rich Townsend
- Re: compare two dynamic string
- From: TC
- compare two dynamic string
- Prev by Date: Modules in parallel programming
- Next by Date: Re: compare two dynamic string
- Previous by thread: Re: compare two dynamic string
- Next by thread: Re: compare two dynamic string
- Index(es):