home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / fortran / 5199 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.6 KB

  1. Path: sparky!uunet!news.univie.ac.at!scsing.switch.ch!univ-lyon1.fr!ghost.dsi.unimi.it!rpi!uwm.edu!spool.mu.edu!agate!dog.ee.lbl.gov!news!network.ucsd.edu!sdcc12!sdcc15!am299bv
  2. From: am299bv@sdcc15.ucsd.edu (Ravinder Bhumbla)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Comments in input files (not source code)?
  5. Message-ID: <44077@sdcc12.ucsd.edu>
  6. Date: 27 Jan 93 08:41:31 GMT
  7. Sender: news@sdcc12.ucsd.edu
  8. Reply-To: rbhumbla@ucsd.edu (Ravinder Bhumbla)
  9. Followup-To: poster
  10. Organization: University of California, San Diego
  11. Lines: 31
  12. Nntp-Posting-Host: sdcc15.ucsd.edu
  13.  
  14. How would one go about writing a program that would understand a `$'
  15. in a data file to be a comment character and would skip to the next
  16. line as soon as it encountered it?  That would enable you to document
  17. input data nicely.  I can't think of a simple way to do it.  Please
  18. forgive me if this is an RTFM question but my Fortran book did not
  19. have any suggestion.
  20.  
  21. The only way I have been doing it so far is to add information at the
  22. end of each line where my program does not expect any data to be.  For
  23. example I could have the following source code:
  24.     ...
  25.     read(7,*) abc, ijk, def
  26.     read(7,*) nnn, rrr
  27.     ...
  28.  
  29. and the input file would be:
  30.     ...
  31.     10.0 5 25.6  These are values for abc, ijk, def
  32.     235 22.5     These are values for nnn, rrr
  33.     ...
  34.  
  35. But this does not let me put comments at arbitrary places in the input
  36. data.  Could you please let me know what techniques you use to add
  37. comments to your input data files?  Please e-mail directly to me and
  38. I'll post a summary if I get any positive responses.
  39.  
  40. Thanks,
  41. Ravi
  42.  
  43. --
  44. Ravinder Bhumbla    rbhumbla@ucsd.edu    U. of California, San Diego
  45.