home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / fortran / 3056 < prev    next >
Encoding:
Internet Message Format  |  1992-08-16  |  1.3 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!wupost!cs.utexas.edu!sun-barr!news2me.ebay.sun.com!exodus.Eng.Sun.COM!appserv.Eng.Sun.COM!appserv!khb
  2. From: khb@chiba.Eng.Sun.COM (Keith Bierman fpgroup)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: programming style question
  5. Message-ID: <KHB.92Aug16161904@chiba.Eng.Sun.COM>
  6. Date: 16 Aug 92 20:19:04 GMT
  7. References: <1992Aug16.195651.25319@news.Hawaii.Edu> <1992Aug16.221725.6760@ee.ubc.ca>
  8. Organization: Sun MegaSystems
  9. Lines: 25
  10. NNTP-Posting-Host: chiba
  11. In-reply-to: davem@ee.ubc.ca's message of Sun, 16 Aug 1992 22:17:25 GMT
  12.  
  13.  
  14. >    Is it dangerous or poor practice to assume that the variables
  15.  
  16. A careful reading of the standard will reveal that this is indeed,
  17. poor practice.
  18.  
  19. If you wish to have a variable retain its old value across
  20. invokations, you must use the 
  21.  
  22.     SAVE foo
  23.  
  24. or the blanket
  25.     
  26.     SAVE
  27.  
  28. in the function/subroutine you wish to behave in this fashion. Of
  29. course, putting the variable in COMMON     (so long as the COMMON is
  30. always in scope, typically part of your main program) is equally safe.
  31.  
  32. This is, in fact, why the SAVE command exists.
  33. --
  34. ----------------------------------------------------------------
  35. Keith H. Bierman    keith.bierman@Sun.COM| khb@chiba.Eng.Sun.COM
  36. SunPro 2550 Garcia MTV 12-33             | (415 336 2648) fax 964 0946
  37. Mountain View, CA 94043  <speaking for myself, not Sun*> Copyright 1992
  38.