PRB: @...GET-Popup From Array Contains Blank Elements

Last reviewed: April 29, 1996
Article ID: Q97643
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5x, 2.6, 2.6a
  • Microsoft FoxPro for Windows, versions 2.5x, 2.6, 2.6a

SYMPTOMS

Elements of an array viewed by an @...GET - Popup FROM <array> do not appear in the popup list. Also, as the @...GET - Popup is activated within FoxPro version 2.5 for WINDOWS, the scroll bars begin to disappear and continue to do so with each successive activation of the popup until the entire scroll bar has disappeared.

CAUSE

DIMENSIONing an array places the array in a physical location in memory. When you create an @...GET - Popup from the array, the popup references the array's physical memory location. If the array is RELEASEd from memory and new data is copied into the previously RELEASEd array, the array is placed into a new physical memory location. However, the @...GET - Popup points to the original physical memory location. As a result, the popup appears to contain blank values for each element in the original array.

In FoxPro for Windows, an additional problem occurs. The popup scroll bar begins to disappear with each successive attempt to use the popup.

Steps to Reproduce Problem

  1. In the Command Window, type "MODIFY COMMAND test.prg" (without the quotation marks).

  2. In test.prg, type

          DIMENSION poparray(500)
          USE customer
          @ 2,2 GET mycno ;
    
              PICTURE "@^ 1;2" ;
              VALID myproc() DEFAULT "1"
          @ 7,2 GET yourcno ;
              PICTURE "@^" ;
              FROM poparray DEFAULT "Yes"
          READ CYCLE
    
          FUNCTION myproc
          RELEASE poparray
          COUNT FOR cno = "A" TO mcount
          && COUNT FOR Cust_ID="A" TO mcount   in Visual FoxPro
          GO TOP
          DIMENSION poparray(mcount)
          COPY TO ARRAY poparray FIELDS cno FOR cno="A"
          &&COPY TO ARRAY poparray FIELDS Cust_id FOR Cust_id="A"
          SHOW GETS
          RETURN .T.
    
    

RESOLUTION

  1. In the first DIMENSION statement of the program file, DIMENSION the array to the maximum number of rows it will ever contain.

  2. In both DIMENSION statements, specify a row and column number, as in the following example:

          DIMENSION poparray(10,1).
    

  3. Remove the RELEASE command from the VALID PROCEDURE.


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


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: April 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.