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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BROWSE Command

Status
Not open for further replies.

GrayCat

Programmer
Jul 12, 2002
13
US
Our application freezes on a browse command with a for condition. The task manager shows Foxpro Not Responding. What does not responding mean?

This file is growing all the time, it is over 2.2 mil records and only 168,000 kb in size. This has just started happening. So I don't see it as a code problem. However, there could stand to be some optimization here.

Is there a size constraint on the browse command?
 
GrayCat,
The problem with a Browse with a FOR is that it needs to read each and EVERY record in the table to see if it qualifies. Especially on a network this could take a long time for 2.2 million records.

Are you filtering on an Indexed expression? If you are, consider using the optional [KEY <expr1>[, <expr2>]] instead - it's much faster.

You may also want to use a SQL SELECT to create a cursor that does the filtering, again depending on the expression this can speed up things greatly. (Of course this option changes a lot more code if you need to update in the browse window.)

Rick

 
GrayCat,
in addition to Ricks suggestions:

if possible (no matter record time order) reorder file
by your master index, similarly as
(before start create safe backup copy !)

use Myfile
set orde to MyMasterIndex
copy to SortedFile
zap
set orde to
appe from SortedFile

try Norton Speed Disk (or similar)
to eliminate disc fragmentation.
(BTW, if possible split oldier data to archive..)
Tesar
 
Thank you both for your responses.
I changed the FOR to a KEY and it works great.
Still wondering about the &quot;Not Responding&quot; message.
Is Foxpro locked up at that point?
 
&quot;Locked up&quot; is so judgemental! Just say it's busy. :)

Remember that FPW was written for Win3.x which was much more forgiving due to it's more voluntary task switching. The 32-bit OSs really don't like anyone using the CPU for a long period.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top