home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!caen!news.cs.indiana.edu!ux1.cso.uiuc.edu!news
- From: ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi)
- Subject: Re: Whats the difference between STATIC variables and SAVE variables?
- Message-ID: <BxHG3I.M8r@ux1.cso.uiuc.edu>
- Sender: news@ux1.cso.uiuc.edu (News)
- Reply-To: ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi)
- Organization: MRL - UIUC
- References: <1992Nov7.161830.7705@netcom.com> <davidm.721341404@voltaire>
- Date: Tue, 10 Nov 1992 04:21:04 GMT
- Lines: 41
-
- In article <davidm.721341404@voltaire>, davidm@voltaire.Rational.COM (David Moore) writes:
- |>
- |>[ ... good reasons for using SAVE rather than the compilation flag. ]
- |>
- |>REMARKS:
- |>
- |>I have seen programs which assume that parameters passed once will remain
- |>bound on subsequent calls to entry statements which lack those parameters.
- |>For example, this is sometimes used to allocate memory dynamically. When you
- |>find such a program, locate the original card deck, drop from the top of a tall
- |>building, and see if you can erase all the disk copies before the deck hits
- |>the ground (hint; remove the rubber bands)
-
- if you use SAVE, what's wrong with this technique ?
- you can do poor man's "packages". i find them very useful when you
- have data that you do not want to expose to the whole world, and you want
- to act on them in many ways. example:
-
- call histogram_initialize(n,xmin,xmax)
- ...
- do i=...
- ...
- call histogram_accumulate(x(i))
- ...
- enddo
- call histogram_output
-
- and the histogram array (SAVEd, of course) is local to the 'histogram' package,
- which is a single routine with three entry points.
- I have this in a lot of programs and find it useful. I would be delighted to
- punch them on cards and do what you suggest (after backup on a DAT),
- which is a bit anti-environmental but sounds as lots of fun, but unfortunately
- I cannot find a card puncher around ... :-)
-
- --
- Furio Ercolessi
- Materials Research Laboratory | Intl School for Advanced Studies
- Univ. of Illinois at Urbana-Champaign | Trieste, Italy
- furio@uiuc.edu | furio@sissa.it
- Path: maureen.cen.uiuc.edu!user
- From: mtan@ux1.cso.uiuc.edu (Maureen Tan)
-