home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!unixhub!slacvx.slac.stanford.edu!fairfield
- From: fairfield@slacvx.slac.stanford.edu
- Newsgroups: comp.lang.fortran
- Subject: Re: Assigning numeric variables to strings
- Message-ID: <1992Jul30.105946.1@slacvx.slac.stanford.edu>
- Date: 30 Jul 92 18:59:46 GMT
- References: <Bs7qD3.F70@news.cso.uiuc.edu>
- Sender: news@unixhub.SLAC.Stanford.EDU
- Organization: Stanford Linear Accelerator Center
- Lines: 18
- Nntp-Posting-Host: slacvx.slac.stanford.edu
-
- 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)?
-
- Use an "internal write" to the string, e.g.,
-
- WRITE (STRING(38:39), '(I2)') INT(XX)
-
- where XX is your REAL variable.
-
- --
- Dr. Kenneth H. Fairfield | Internet: Fairfield@Slacvx.Slac.Stanford.Edu
- SLAC, P.O.Box 4349, MS 98 | DECnet: 45537::FAIRFIELD (45537=SLACVX)
- Stanford, CA 94309 | BITNET Fairfield@Slacvx
- ----------------------------------------------------------------------------
- These opinions are mine, not SLAC's, Stanford's, nor the DOE's...
-