Microsoft KB Archive/97643

{| = PRB: @...GET-Popup From Array Contains Blank Elements =
 * width="100%"|

ID: Q97643

2.00 2.50x 2.60 2.60a | 2.50x 2.60 2.60a 3.00

MS-DOS               | WINDOWS kbprg kbprb 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 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 &quot;MODIFY COMMAND test.prg&quot; (without the

quotation marks). 2. In test.prg, type     DIMENSION poparray(500)      USE customer      @ 2,2 GET mycno ;          PICTURE &quot;@^ 1;2&quot; ;          VALID myproc DEFAULT &quot;1&quot;      @ 7,2 GET yourcno ;          PICTURE &quot;@^&quot; ;          FROM poparray DEFAULT &quot;Yes&quot;      READ CYCLE

FUNCTION myproc RELEASE poparray COUNT FOR cno = &quot;A&quot; TO mcount && COUNT FOR Cust_ID=&quot;A&quot; TO mcount  in Visual FoxPro GO TOP DIMENSION poparray(mcount) COPY TO ARRAY poparray FIELDS cno FOR cno=&quot;A&quot; &&COPY TO ARRAY poparray FIELDS Cust_id FOR Cust_id=&quot;A&quot; 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: kbprg kbprb KBSubcategory: FxenvMemory

Keywords         : kbenv FxenvMemory Version          : 2.00 2.50x 2.60 2.60a | 2.50x 2. Platform         : MS-DOS WINDOWS
 * }