×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • 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.

Students Click Here

How to convert integer to character type in F90

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.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


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:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close