Wouldn't even BETTER practice be to just ensure that the file is open in the calling program?
If this is a "well used" routine that is called for a couple of million records, then even the overhead of this simple check can quickly mount. Whilst I agree that it is "good" that code should try & catch errors, I think that this is a classic example of where the real "fix" is to fix the "problem" that is in the calling routine .... removes a whole error trap routine (what DO you do if the file isn't open & this is in the middle of a batch update?) that shouldn't exist in the first place. YMMV Ross Ferris Stamina Software Visage > Better by Design! >-----Original Message----- >From: [EMAIL PROTECTED] [mailto:owner-u2- >[EMAIL PROTECTED] On Behalf Of David Jordan >Sent: Sunday, 4 May 2008 10:11 PM >To: [email protected] >Subject: RE: [U2] passing file pointers? > >Use the Fileinfo routine. > >If fileinfo(fv,1) = (if 0 not open, if 1 open) > >This checks that is a valid file that is open. > >This is good practice to test the file is open before opening, as >reopening >the file clears all previous record locks held on that file by that user >and >can cause fatal errors when using transaction boundaries > >Regards > >David Jordan >------- >u2-users mailing list >[email protected] >To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
