home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!think.com!Think.COM!sandee
- From: sandee@Think.COM (Daan Sandee)
- Newsgroups: comp.lang.fortran
- Subject: Re: Assigning numeric variables to strings
- Date: 30 Jul 1992 18:00:50 GMT
- Organization: TMC
- Lines: 16
- Distribution: world
- Message-ID: <159aoiINNs1k@early-bird.think.com>
- References: <Bs7qD3.F70@news.cso.uiuc.edu>
- NNTP-Posting-Host: telecaster.think.com
-
- In article <Bs7qD3.F70@news.cso.uiuc.edu>, jal41820@uxa.cso.uiuc.edu (Smiley) writes:
- |> How can one assign a numeric variable to part of a string (e.g., if
- |> fortran allowed this statement, string(38:39) = int(real) is what I
- |> want to do)?
-
- Assuming what you want is to have a substring with a *character
- representation* of the variable *converted to an integer* :
-
- write(string(38:39),'(i2)') int(x)
-
- (Definitely a FAQ, about once a week, luckily not one which creates a
- hundred postings with misinformation and miscellaneous complaints.)
-
- Daan Sandee sandee@think.com
- Thinking Machines Corporation
- Cambridge, Mass 02142 (617) 234-5044
-