KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q250495: PRB: SAVE SCREEN Not Creating Variable on CLEARed Screen

Article: Q250495
Product(s): Microsoft FoxPro
Version(s): WINDOWS:5.0,5.0a,6.0
Operating System(s): 
Keyword(s): kbvfp500 kbvfp500a kbvfp600 kbXBase kbGrpDSFox kbDSupport
Last Modified: 19-JAN-2000

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Visual FoxPro for Windows, versions 5.0, 5.0a, 6.0 
-------------------------------------------------------------------------------

SYMPTOMS
========

When using the SAVE SCREEN TO <memory variable> command, the memory
variable might not be created. When using the RESTORE SCREEN FROM <memory
variable> command, you receive the error:

  Variable <memory variable> is not found.

CAUSE
=====

If the screen has been CLEARed, Microsoft Visual FoxPro is not able to save
anything to the memory variable, so it is not created. If the memory variable
already exists, the information in it is not overwritten.

RESOLUTION
==========

Output of some kind to the screen (Visual FoxPro Desktop) enables the SAVE
SCREEN TO command to create the memory variable. The statement:

  ? SPACE(0)

right after the CLEAR command places a null string on the screen and does not
affect screen appearance, but it causes the SAVE SCREEN TO command to create the
memory variable.

MORE INFORMATION
================

This problem does not occur in Visual FoxPro 3.0b.

Steps to Reproduce Behavior
---------------------------

1. Create a program in Visual FoxPro and add the following statements:

  CLEAR ALL
  CLEAR
  * ? SPACE(0) 
  SAVE SCREEN TO X
  ? VERSION()
  RESTORE SCREEN FROM X
  ? TYPE("X")

2. Run the code and note that the error mentioned in the "Symptoms" section
  appears.

3. Remove the asterisk from the line:

  ? SPACE(0)

  and execute the code again.

Additional query words:

======================================================================
Keywords          : kbvfp500 kbvfp500a kbvfp600 kbXBase kbGrpDSFox kbDSupport 
Technology        : kbVFPsearch kbAudDeveloper kbVFP500 kbVFP600 kbVFP500a
Version           : WINDOWS:5.0,5.0a,6.0
Issue type        : kbprb
Solution Type     : kbpending

=============================================================================

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.

Copyright Microsoft Corporation 1986-2002.