Software Archive
Read-only legacy content
17060 Discussions

Format Question

waynebruce
Beginner
414 Views
Is there a command to convert a character string into a Real number string? If the variable X is initialized as a character and contains the character "3", how do I change it so that "X" is now a real variable containing the number "3"?

thanks.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
414 Views
You can't have the same variable be both a character string and a numeric, but you can do something like this:

READ (XSTRING,*) X

where XSTRING is a CHARACTER variable containing the string "3" and X is a REAL variable. This is called "Internal READ" - look it up in the Compaq Fortran Language Reference Manual.

Steve
0 Kudos
Reply