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

ID: Q114250

The information in this article applies to:

  • Microsoft FoxPro for Windows, versions 2.5x, 2.6
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5x, 2.6, 2.6a
  • Microsoft FoxPro for Macintosh, version 2.5b

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:

  • The preferred solution is to issue a CLEAR PROGRAM command immediately before the DO test statement in TXTMRG.PRG. The CLEAR PROGRAM command is designed to force FoxPro to reload the desired program file from disk.

    -or-

  • Issue a SET DEVELOPMENT ON command immediately before the first SET TEXTMERGE command. Although the default for SET DEVELOPMENT is ON, adding this line to a program forces FoxPro to reload the file from disk. However, changing the setting of SET DEVELOPMENT may not be desirable within a program.

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
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.