Article View: comp.lang.pascal.borland
Article #414Re: Multiple file open/close anomaly?
From: Robert AH Prins
Date: Sat, 05 Dec 1998 00:00
Date: Sat, 05 Dec 1998 00:00
54 lines
2291 bytes
2291 bytes
In article <36685A89.70BC2B0F@eunet.at>,
"Ing. Franz Glaser" <meg-glaser@eunet.at> wrote:
> Robert AH Prins wrote:
> >
> > Take this snippet:
> >
> > const
> > sfile: integer = -1;
> >
> > procedure open(_file: integer);
> > begin
> > {$ifdef fast}
> > if _file <> sfile then
> > begin;
> > sfile:= _file;
> > {$endif}
> > close(datatout);
> > assign(datatout, files[_file]);
> > settextbuf(datatout, databuf^, 8192);
>
> Are you SURE that this SetTextBuf is done also in your
> first rewrite (which is not shown here obviously)?
> Cannot find any other reason for your experience :-)
> If not, how often do you skip the code here...
Yes, it is!
As for the calling of this procedure, the program where I discovered the
anomaly calls open 64 times, s/39e/s/e/s/e/s/18e/s (s = summary, e =
individual event), in other words, with "fast" defined it skips the code 55
times! BTW, first group of 39 'e's range in size from about 10k to 18k, the
second from about 12k to 24k.
> > if __first_event then
> > begin
> > rewrite(datatout);
> > __first_event:= false;
> > end
> > else
> > append(datatout);
> > {$ifdef fast}
> > end;
> > {$endif}
> > end; {open}
> >
> -----> snip
Robert
--
Robert AH Prins
prinsra@williscorroon.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Technical Details
Message-ID:
<74bee2$bal$1@nnrp1.dejanews.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<749jnl$slc$1@nnrp1.dejanews.com> <36685A89.70BC2B0F@eunet.at>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111659,df5b94058f04a442 X-Google-Attributes: gid111659,public X-Google-Thread: 108ebd,df5b94058f04a442 X-Google-Attributes: gid108ebd,public From: Robert AH Prins <prinsra@williscorroon.com> Subject: Re: Multiple file open/close anomaly? Date: 1998/12/05 Message-ID: <74bee2$bal$1@nnrp1.dejanews.com> X-Deja-AN: 418931234 References: <749jnl$slc$1@nnrp1.dejanews.com> <36685A89.70BC2B0F@eunet.at> X-Http-Proxy: 1.0 x11.dejanews.com:80 (Squid/1.1.22) for client 193.130.234.1 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Sat Dec 05 14:02:42 1998 GMT Newsgroups: comp.lang.pascal.borland,borland.public.turbopascal X-Http-User-Agent: Mozilla/3.0 (Win16; I)