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

  1. Path: sparky!uunet!ogicse!hp-cv!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!eagle!rogers
  2. From: rogers@eagle (Bill Rogers)
  3. Newsgroups: comp.lang.c++
  4. Subject: RE:Help? TV stream...DAMN!
  5. Message-ID: <Bt8yuw.E40@news.cso.uiuc.edu>
  6. Date: 19 Aug 92 20:13:43 GMT
  7. Article-I.D.: news.Bt8yuw.E40
  8. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  9. Organization: Sangamon State University
  10. Lines: 37
  11. X-Newsreader: Tin 1.1 PL4
  12.  
  13. My newreader and emacs are fighting each other. Sorry bout that above.
  14.  
  15. Let's start again.
  16.  
  17. How do I check to see if a stream created object was actually creted without
  18. error? Here is the constructor that seems to work just fine, I can't
  19. tell the caller what happen without using a global, something I'd rather not.
  20.  
  21.  
  22. TFieldCollection::TFieldCollection( char *filename ):
  23.                 TCollection (streamableInit ) {
  24.     if(filename == NULL) return;
  25.     ifpstream in( filename );
  26.     if (in) {
  27.     // This is cool, but I could use some error checking here also.
  28.     in >> *this;
  29.     in.close();
  30.     } else { // Damn no file found!
  31.     messageBoxRect (TRect(10,10,50,19),mfOKButton,
  32.         "Damn! file: %s not opened.",filename );
  33.     }  /* if (in) */
  34. }
  35.  
  36. I call this like:
  37.      TFieldCollection *fc = new TFieldCollection("somefile.ext");
  38. but:
  39.     if(fc) //doesn't seem to work
  40.  
  41. TIA,
  42. Bill
  43. --
  44. <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
  45. <> Bill Rogers, Assistant Director for Academic Computing Services          <>
  46. <>              Sangamon State University, HSB-115                          <>
  47. <>              Springfield, Il 62794-9243     fax:217-786-7188             <>  
  48. <> Internet:rogers@eagle.sangamon.edu        voice:217-786-7352(Mon.->Thur.)<>
  49. <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
  50.