Fox 2.6 Win calling Borland Pascal 7.0 Win - problem 
Author Message
 Fox 2.6 Win calling Borland Pascal 7.0 Win - problem

(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.
  HELP!!!



Tue, 11 Jun 2002 03:00:00 GMT
 Fox 2.6 Win calling Borland Pascal 7.0 Win - problem

Can you get your pascal program to run at all under windows?
If so; create a PIF file (ie: shortcut) for it; then instead of calling the exe
directly; call the pif file instead.
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.



Tue, 11 Jun 2002 03:00:00 GMT
 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



Tue, 11 Jun 2002 03:00:00 GMT
 Fox 2.6 Win calling Borland Pascal 7.0 Win - problem


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 "MYFILE.DBF"  && calls Pascal with the filename as parameter
>Here's the Pascal part:
>  VAR
>    MYDBF: file;  { untyped }
>    BUF: string;
>  BEGIN
>    ASSIGN (MYDBF, 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.
>  HELP!!!

 I got two replies: from Josh, and from Alexandre. Thanks very much for
your help: HOWEVER, the solutions don't work. FLUSH has no effect, and
I am unwilling to fool much with the settings of Win98. A PIF file
would work for a DOS Pascal program, but the program must be Windows.
  To sum up: Fox Windows is calling Pascal Windows. Fox has used a
DBF, but has closed it. However, the Pascal program thinks it is still
open.
  Is there any process that the Pascal program can use to force the
DBF to be closed - can the file control blocks be accessed?


Wed, 19 Jun 2002 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Problem with Foxpro 2.6 on Win 95 and Win 3.x

2. Fox 2.6 win printing multi collumn report to Tally Line Printer

3. Fox 2.6 WIN causes STACK FAULT under Windows NT 4.0

4. Fox Win 2.6 - Reports with variable columns?

5. Fox 2.6 Win - Radio Buttons - changing colour of background

6. Fox 2.6 & Win 95

7. Foxpro for win 2.6: change fox pictogram

8. Fox Win 2.6: ON KEY and ON ESCAPE routines

9. win 95 / fox 2.6 report preview bug

10. Fox Win 2.6 Internal Consistency Error

11. Fox 2.6 errors on Win 3.11 for workgroups

12. fox 2.6 for windows under Win 95


 
Powered by phpBB® Forum Software