home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / fortran / 4267 < prev    next >
Encoding:
Text File  |  1992-11-10  |  1.7 KB  |  38 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!news.tek.com!psgrain!charnel!rat!usc!zaphod.mps.ohio-state.edu!uwm.edu!spool.mu.edu!news.cs.indiana.edu!nstn.ns.ca!cs.dal.ca!biome!silvert
  3. From: silvert@biome.bio.ns.ca (Bill Silvert)
  4. Subject: Re: Multiple includes
  5. Message-ID: <1992Nov10.213909.4759@biome.bio.ns.ca>
  6. Reply-To: silvert@biome.bio.dfo.ca (Bill Silvert)
  7. Organization: Habitat Ecology Div., Bedford Inst. Oceanography
  8. References: <1dotfaINN4a1@alnitak.usc.edu>
  9. Distribution: na
  10. Date: Tue, 10 Nov 1992 21:39:09 GMT
  11. Lines: 25
  12.  
  13. In <1dotfaINN4a1@alnitak.usc.edu> olaf@alnitak.usc.edu (Olaf Meeuwissen) writes:
  14.  
  15. >The reason  for this is  that I want to put all  the maximum dimensions for the
  16. >arrays used in the program in one single file,  so the user knows where to find
  17. >them if they have to be changed. Let's call this file `dim.h'. Now I have other
  18. >header files, say `lib.h' and `sys.h', that both contain some arrays, so I want
  19. >to include `dim.h'.  Then, if I have to include both `lib.h' and `sys.h' in one
  20. >subroutine, yes, the compiler starts complaining!  Of course, I get similar re-
  21. >sults if I want to include `dim.h' and any of the other header files.
  22.  
  23. Not knowing what compiler you are using, an authoritative answer is not
  24. possible (include is non-standard).  However, you might be able to use
  25. the trick that C includes do, namely:
  26.  
  27. #ifndef DIM_H
  28. #define DIM_H
  29. ....
  30. #endif
  31.  
  32. and run it through cpp or other preprocessor.
  33. -- 
  34. ------------------------------------------------------------------------
  35. William Silvert, Habitat Ecology Division, Bedford Inst. of Oceanography
  36. P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2.  Tel. (902)426-1577
  37. InterNet Address: silvert@biome.bio.dfo.ca
  38.