home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!spool.mu.edu!uwm.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uimrl7.mrl.uiuc.edu!ercolessi
- From: ercolessi@uimrl4.mrl.uiuc.edu (furio ercolessi)
- Subject: Re: Print characters on one line without newline...???
- References: <BxtnK6.23s@cs.uiuc.edu>
- Message-ID: <Bxtr38.8p9@news.cso.uiuc.edu>
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Reply-To: ercolessi@uimrl4.mrl.uiuc.edu (furio ercolessi)
- Organization: MRL - UIUC
- Date: Mon, 16 Nov 1992 19:49:53 GMT
- Lines: 35
-
- In article <BxtnK6.23s@cs.uiuc.edu>, ctaylor@cs.uiuc.edu (Conrad W Taylor) writes:
- |> I'm writting this PrintX routine that is to print
- |>the letter X n times on one line without any spaces and
- |>newline. My PrintX routine looks like this:
- |> [...]
- |>
- |>This routine only prints one 'X' on n lines and I want it to print
- |>n X's on one line without any spaces in between and without a new-
- |>line character. Could someone explain what I might be doing wrong?
-
- I do not think this can be done using standard Fortran.
- Many compilers, however, offer a FORMAT extension usually
- called $ which allows this, and works as follows:
-
- SUBROUTINE PrintX(XCOUNT)
- INTEGER XCOUNT
-
- INTEGER i
-
- DO 10 i=1, XCOUNT
- PRINT 20
- 10 CONTINUE
- 20 FORMAT($, 'X')
-
- PRINT *
-
- RETURN
- END
-
- You may have a hard time in doing this on IBM mainframes :-)
- --
- Furio Ercolessi
- Materials Research Laboratory | Intl School for Advanced Studies
- Univ. of Illinois at Urbana-Champaign | Trieste, Italy
- furio@uiuc.edu | furio@sissa.it
-