PRB: FoxPro Runs Old Version of Program Created w/ Text Merge

ID: Q114250

The information in this article applies to:

SYMPTOMS

A program that creates a second program then runs the newly created program runs an older version of the second program.

CAUSE

When a program in memory is run again, FoxPro does not reload the program from disk. Instead, the existing version in memory is used.

STATUS

This behavior is by design to enhance the speed of FoxPro.

NOTE: This does not occur in FoxPro 2.6a for Windows.

RESOLUTION

There are two ways to force FoxPro to read the most current copy of the program file from disk:

MORE INFORMATION

Steps to Reproduce Behavior

1. Create a program named CALLPRG that contains the following command:

      WAIT WINDOW "Version before text merge"

2. In the Command window, type the following command:

      DO callprg

3. Create a program named TXTMRG that contains the following commands

      SET TALK OFF
      SET TEXTMERGE TO "callprg.prg"
      SET TEXTMERGE ON
      WAIT WINDOW NOWAIT "Version after text merge"
      SET TEXTMERGE OFF
      SET TEXTMERGE TO
      DO callprg

4. In the Command window, type the following command:

      DO txtmrg

A wait window that says "Version before text merge" appears because FoxPro uses the copy of CALLPRG that exists in memory.

Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b 2.60 2.60a KBCategory: kbenv kbprg kbprb KBSubcategory: FxenvMemory

Last Reviewed: June 27, 1995