FIX: Storing Array Elements Causes GP Fault

ID: Q140516

3.00 WINDOWS kbprg kbfixlist kbbuglist

The information in this article applies to:

  • Microsoft Visual FoxPro for Windows, version 3.0

SYMPTOMS

Running the CLEAR ALL command in the Command window results in an error such as:

   Use of Unallocated Handle

   -or-

   This program has performed an illegal operation and will be shut down.

CAUSE

It is likely that you have used the STORE command to assign values to an array.

WORKAROUND

Instead of using the STORE command to assign values to your array, use the assignment operator (=).

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual FoxPro version 3.0b for Windows.

MORE INFORMATION

Steps to Reproduce Problem

1. Run the following code:

   -=-=-=-=-=-=-=-=-=-=-=-=
        BEGIN CODE
   -=-=-=-=-=-=-=-=-=-=-=-=
   PUBLIC yy
   yy = CREATEOBJECT("cc")
   RETURN

   DEFINE CLASS cc AS Custom
   DIMENSION ee(1)
   DIMENSION bb(1)

   PROCEDURE Whatever
   LOCAL ltemp

   DO FORM C:\VFP\TEST NAME ltemp LINKED

   *-- Use the following two lines to demonstrate the error.
   STORE ltemp TO THIS.bb(1)
   STORE ltemp TO THIS.ee(1)

   *-- Use the following two lines to demonstrate the workaround.
   * THIS.bb(1) = ltemp
   * THIS.ee(1) = ltemp

   ENDPROC
   ENDDEFINE
   -=-=-=-=-=-=-=-=-=-=-=-=
     END CODE
   -=-=-=-=-=-=-=-=-=-=-=-=

2. In the Command window, enter the following line of code:

   yy.Whatever()

3. In the Command window, enter the following line of code:

   CLEAR ALL

To work around the problem, change the STORE lines into comments and change the lines that use the assignment operator into executed lines to see the workaround.

Additional reference words: 3.00 VFoxWin buglist3.00 fixlist3.00b KBCategory: kbprg kbfixlist kbbuglist KBSubcategory: FxprgGeneral

Keywords          : FxprgGeneral kbbuglist kbfixlist
Version           : 3.00
Platform          : WINDOWS
Solution Type     : kbfix


Last Reviewed: October 31, 1997
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.