I found a sort of a workaround for the Insufficient Memory error that my users were getting.
The scenario is that a popup is defined within a window, from a table of several hundred records. Removing some of the records is of course, not an option. Using an array has it's own drawbacks, so I wanted to stick with the code at hand.
Anyway, the user would start typing the customer name, which would position the selection bar on the closest match. It works fine on slower machines but on faster ones, FoxPro would generate the error after more than 1 character was typed. So, I set the error handler off while the popup is active and reset it to my error handler once the selection is made. Here's the code:
So, the code above causes FoxPro to temporarily ignore the error message and continue.
Dave S.
The scenario is that a popup is defined within a window, from a table of several hundred records. Removing some of the records is of course, not an option. Using an array has it's own drawbacks, so I wanted to stick with the code at hand.
Anyway, the user would start typing the customer name, which would position the selection bar on the closest match. It works fine on slower machines but on faster ones, FoxPro would generate the error after more than 1 character was typed. So, I set the error handler off while the popup is active and reset it to my error handler once the selection is made. Here's the code:
Code:
SET CONFIRM ON
STORE .T. TO lpoperror
DO WHILE lpoperror
STORE .F. TO lpoperror
DEFINE POPUP newcust FROM 0.5, 0.5 TO 10, 54 ;
PROMPT FIELD customer.custname + ;
' - ' + STR(VAL(customer.custnumber));
SCROLL
ON SELECTION POPUP newcust DEACTIVATE POPUP newcust
ON ERROR lpoperror = .T.
ACTIVATE POPUP newcust AT 1, 1 REST
ENDDO
RELEASE lpoperror
SET CONFIRM OFF
ON ERROR DO errhand WITH ;
ERROR(), ;
MESSAGE(), ;
MESSAGE(1), ;
LINENO()
*... rest of code
Dave S.