BUG: Variable Name Length Affects Results of RESTORE FROM

Last reviewed: June 27, 1995
Article ID: Q123283
The information in this article applies to:
  • Microsoft FoxPro for Windows, version 2.6a
  • Microsoft FoxPro for Macintosh, version 2.6a

SYMPTOMS

The RESTORE FROM command will not always restore the value of a variable that was saved with the SAVE TO command if the variable name contains more than 10 characters. The current value of the variable will remained unchanged.

This behavior occurs only in the Windows and Macintosh platforms. In the MS- DOS and UNIX platforms, the RESTORE FROM command restores the saved value of the variable even if the variable name contains more than 10 characters.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

RESOLUTION

You can work around this problem by ensuring that all variable names declared contain no more than 10 characters.

MORE INFORMATION

The problem occurs when the variable name in the following command contain more than 10 characters:

   SAVE TO <filename> ALL LIKE <variable name>

For example, the problem occurs in the following cases:

   SAVE TO temp ALL LIKE h_vartoolong

   - or -

   SAVE TO temp ALL LIKE h_vartoolon?

RESTORE FROM will set the variable to the correct value:

   SAVE TO temp ALL LIKE h*

H_vartoolong is the variable name.

Sample Code to Reproduce Problem

Type the following code in the Command window:

   h_vartoolong=1
   SAVE TO temp ALL LIKE h_vartoolong
   h_vartoolong=2
   RESTORE FROM temp additive
   ?h_vartoolong && This will return a 2 instead of the expected 1


Additional reference words: FoxWin FoxMac 2.60a buglist2.60a
KBCategory: kbprg kbbuglist
KBSubcategory: FxprgGeneral


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.