Home > Archive > Fortran > January 2006 > Re: How to compare two strings?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: How to compare two strings?
|
|
|
| Rich Townsend wrote in message ...
>jane.sync@yahoo.com wrote:
[color=darkred]
>I think you've found a work-around, not a fix. The problem is the declaration of
>str1. If you pass a string of length shoother than 12, (say, 5), then the
>characters of str1 from position 6 onwards will contain garbage. It is this
>garbage that prevents str1 from being equal to 'test'; but the collating
>operators (LLT and LGT)
These are functions, not operators.
> will still work.
>The fix? Replace
>
>character(12) str1
>
>by
>
>character(*) strl
str1
| |
| Rich Townsend 2006-01-30, 9:57 pm |
| robin wrote:
> Rich Townsend wrote in message ...
>
>
>
>
>
> These are functions, not operators.
Wow, thanks for correcting that gaping hole in my assesment. My mistake totally
invalidates the advice I offered the OP.
|
|
|
|
|