Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
14 Views

how to find the error in TRIM and String

Dear all,

I have a problem with a string.

I have this piece of code:

 write(*,*) LEN(lead_print_name), LEN(TRIM(lead_print_name))

 

the results is:

         100         100

 

However, 

lead_print_name = "gaussian"

 

What could be the possible error in my code?

thanks to everyone

 
0 Kudos
3 Replies
Highlighted
14 Views

How about you show us a small but complete program that demonstrates the problem? My experience is that code snippets often hide the actual source of error.

0 Kudos
Highlighted
Beginner
14 Views

Dear Steve, Dear all,

thanks a lot. It was a error of mine.

Thanks again for your time. 

In my case there is a selectcase to select the correct words in the name lead_print_name. 

 Unfortunately, no cases were matched and this creates empties spaces.

 

Thanks again

0 Kudos
Highlighted
Black Belt
14 Views

diedro wrote:

In my case there is a selectcase to select the correct words in the name lead_print_name. Unfortunately, no cases were matched and this creates empties spaces.

I think that the last part ("creates empty spaces") is incorrect. If no matching clause was found in a SELECT construct, the variable in question would simply retain its previous value. That previous value could be a string of spaces, or it could be anything else, but nothing was created as a consequence of executing the SELECT statement.

0 Kudos