Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insufficient Memory - Define Popup

Status
Not open for further replies.

DSummZZZ

Programmer
Oct 24, 2000
4,250
US
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:

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
So, the code above causes FoxPro to temporarily ignore the error message and continue.

Dave S.
 
Dave,
If you go to and get the free "FPWListBox" file, there is a "readme" file discussing this problem and some sample code for a workaround that Paul has provided.

Rick
 
Yes, I saw that and in fact, downloaded it and looked it over. My problem was that although an error doesn't get generated while building the popup, it does occur when typing the customer name to position the select bar. (Incremental search).
Unfortunately, the solution you pointed me to doesn't work in this case.

Dave S.
 
Hello DSummZZZ

First of all try to increase physicall ram of your user computer.

Than try to use foxprox.exe file in order to use the extended version of foxpro.

Also try to run your program while no other programs are running.

Following changes in config.sys can also help you to solve your problem but not much authenticated.

files=200
buffers=50

If your problem still not resolved, then plz let me know
your operating system.
your computer capacity.
which version of foxpro you are using.

Regards

Tanveer Ahmad
tanveer@all.com.pk
 
This is a FoxPro Windows 2.5 app, not DOS. The files settings aren't an issue, that is set high enough. I believe it's more the faster processor speeds, since when I originally wrote the app (5+ years ago), it ran fine on ~33 mhz machines. Before we get into that though, I have tried all the 'faster processor speed' patches but there is still some sort of internal issue that we will never be able to resolve since MS no longer supports the product.

But for the sake of explanation, this app is running on the following configurations:
-Windows 3.1, '95, '98, NT 3.1, 4.0, 2000, XP, ME.
-The p.c.'s use anywhere from 32 meg ram up to 512.
-There is plenty of disk space on all machines.
-The app works the same whether run from a network or
a local drive.
-It behaves the same way running as a .PRG/.FXP or if
compiled using FoxPro 2.5 Distribution kit.
-I know there is a 2.6 version out there, but 2.5 is what I
have and it does everything I need it to do for this
app.
-This is a legacy system I am maintaining while developing
a VFP version. Anything else I need, I will use VFP
for.

Thanx for the reply though,
Dave S.
 
Thanks for sending me your details.
Plz make changes in config.fpw file and add following line

mvcount=

range will be from 255 to 65000.

If you use extended version, it can sport upto 65000.
You can also read config.fpw help file. Regards

Tanveer Ahmad
tanveer@all.com.pk
 
I already have that statement in place. It is currently set at 2048. I made sure this was not an issue by setting it at different levels all the way to 6500 previously.

Dave S.
 
Instead of making popup directly from table. it is more convinent that you make some changes in your program so that your end user Enters name of the customer in a text box and then popup is created using values of the text box. In this way your popup list gets shorter and hope you solve your problem.

Me too use the same criteria for large of records to be shown to the user in order to select the desire one.

Plz reply me if you solve your problem. Regards

Tanveer Ahmad
tanveer@all.com.pk
 
It's possible to select a subset of the table and create a list for the user to select. However, it doesn't matter how big the list is, I have run into this problem with only a few items also.
Since my solution seems to be working so far, I'm going to leave it like it is.
The list consists of a customer base, ~400 records. Some of the customer names are rather unique but a subset wouldn't be that much benefit for locations which have names like '7-11 #23456' or '7-11 #34567'. We have over 140 7-11's so users still have to scroll through a bunch of them.

Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top