Microsoft KB Archive/105506

{| = FIX: "Record out of Range" Error Caused by DEFINE POPUP =
 * width="100%"|

ID: Q105506

2.50 WINDOWS kbprg kbfixlist kbbuglist kberrmsg

The information in this article applies to:


 * Microsoft FoxPro for Windows, version 2.5

SYMPTOMS
Using a DEFINE POPUP PROMPT FIELD command can cause the following error message:

Record out of range.

STATUS
Microsoft has confirmed this to be a problem in FoxPro 2.5 for Windows. This problem was corrected in FoxPro 2.5a for Windows.

Steps to Reproduce Problem
1. Create and run a program with the following code (assuming you do

not already have a database file with the name TEST.DBF):

SET EXCLUSIVE ON     CREATE TABLE test.dbf (x C(10))

DEFINE WINDOW testwin ; FROM 2,4 ; TO 20,34

DEFINE POPUP testpop ; PROMPT FIELD x SCROLL MARGIN MARK "_"

ACTIVATE WINDOW testwin

@ 0,0 GET m.x ; PICTURE "@&N" POPUP testpop SIZE 17,15 ; DEFAULT " "

@ 7,18 GET m.button ; PICTURE "@*VN Add;Delete;Quit" SIZE 1,8,1 ; DEFAULT 1 VALID testbutton

READ CYCLE

RELEASE WINDOW testwin

FUNCTION testbutton    &&  m.button VALID DO CASE CASE m.button=1 FOR m.i=1 to 5 INSERT INTO test VALUES ('Record ' + STR(i,1)) ENDFOR SHOW GETS CASE m.button=2 ZAP SHOW GETS CASE m.button=3 CLEAR READ ENDCASE 2. Choose the Add button. 3. Choose the Delete button.

You will receive a "Record out of range" program error message box.

Additional reference words: FoxWin 2.50 buglist2.50 fixlist2.50a errmsg err msg KBCategory: kbprg kbfixlist kbbuglist kberrmsg KBSubcategory: FxprgGeneral Solution Type : kbfix
 * }