×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# How to convert integer to character type in F90

## How to convert integer to character type in F90

(OP)
Hi simple example:
"
integer ::  year .....
character::  p1*4, ....
.
.
DO 100 i=fyear, lyear
year = i
p1=trim(year)
write(*,*) p1
..."

Compiling, complaint of course that year is incorrect kind for the function trim.

How to convert an integer to a character ?  any suggestions

### RE: How to convert integer to character type in F90

Not sure what you want.  At a guess it is something like

#### CODE

DO 100 i=fyear, lyear
year = i
write (p1, '(I4)') year
... do whatever with p1
100 continue
Writing to p1 will convert year into character form in p1

### RE: How to convert integer to character type in F90

(OP)
Thanks at lot,

That's what I was trying to accomplish, basically I am writting a program that open/read several files and compile the data into a single file.  The names of files include year, month, etc, that is where the conversion was need it.

thank you again, Mauricio

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!