Error: IF clause at (1) requires a scalar LOGICAL expression

You shouldn’t put ANY in. It was just my tongue-in-cheek remark.

This means both of them were assumed-length character scalars, just like you showed in a previous thread.

You started from a false premise. Don’t make the change to begin with.

Instead, we have four open threads for the same problem,

I’ve mentioned the XY problem in one of your earlier threads. The How To Ask Questions The Smart Way linked on that page also contains some good advice:

Before asking a technical question by e-mail, or in a newsgroup, or on a website chat board, do the following:

  1. Try to find an answer by searching the archives of the forum or mailing list you plan to post to.
  2. Try to find an answer by searching the Web.
  3. Try to find an answer by reading the manual.
  4. Try to find an answer by reading a FAQ.
  5. Try to find an answer by inspection or experimentation.
  6. Try to find an answer by asking a skilled friend.
  7. If you’re a programmer, try to find an answer by reading the source code.

When you ask your question, display the fact that you have done these things first; this will help establish that you’re not being a lazy sponge and wasting people’s time. Better yet, display what you have learned from doing these things. We like answering questions for people who have demonstrated they can learn from the answers.

1 Like