
Fox 2.6 Win calling Borland Pascal 7.0 Win - problem
[ Courtesy cc'ed through e-mail to the quoted author ]
Quote:
>(crossposted on comp.lang.pascal.borland)
>I have a Foxpro (2.6 for Windows) application which interacts with the user,
>and then shells out to a Pascal (BP 7.0 for Windows) program to do
>processing.
>Here's the Foxpro part:
> USE MYFILE.DBF
> ... && do some stuff
> USE && (or CLOSE DATA) to free it for the next Pascal program
> RUN /N MYPASCAL && calls Pascal
>Here's the Pascal part:
> VAR
> MYDBF: file; { untyped }
> BUF: string;
> BEGIN
> ASSIGN (MYDBF, 'MYFILE.DBF'); {actually I pass the name as PARAMSTR(1) }
> RESET (MYDBF, 1);
> BLOCKREAD (MYDBF, BUF[1], 100);
> etc. { routines to process a DBF table }
>Usually this works fine. It worked when both programs were DOS-based
>(Foxpro 2.6 and BP 7.0 for DOS). It also works when Foxpro 2.6 Windows
>calls BP 7.0 DOS. (Both programs are cross-platform, using compile-time
>directives like {$IFDEF WINDOWS)).
> This method also works when both programs are Windows-based, at least with test
>code like the above. However, the real applications do NOT work any more.
> When RESET is tried, I get Runtime error 005 at 0001:CEF5. If I use
>IORESULT, the result is 5. The file cannot be opened, and
>BLOCKREAD fails with error 103.
> I have examined the situation thoroughly, and I am sure MYFILE.DBF
>is closed before the Pascal program is called. And yet, for some reason,
>the Pascal program acts as if the Foxpro program is not releasing it.
> I can't even think of a workaround.
I've run into something vaguely similar on some Windows 9x computers. I believe
the culprit to be Microsoft file system (in combination with hardware cache). I
would try (in that order):
1. FLUSH in FoxPro after USE or CLOSE DATA
2. Disabling write-behind caching, if enabled (System
Properties/Performance/Troubleshooting)
3. Reducing read cache size (same place) by steps.
Quote:
> HELP!!!
HTH. Happy New Year.
[ When replying, remove *'s from address ]
Alexandre Pechtchanski, Systems Manager, RUH, NY