Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: mk sharma
  Where is mk sharma?
 mumbai
 India
 mk sharma
 Tags
Subject: RE: how to optimize/fast this
Thread ID: 268658 Message ID: 268691 # Views: 53 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Wednesday, July 14, 2010 3:17:33 AM         
   


> i have stored required records in a cursor wstkrep and generated a stock report
>
> if the date is less 01-04-2010 then add/less in opening otherwise new record as inward/outward/wastage
>
>
>
> 
> ---------------------------------------------------------------------------------------------
> Date   |  Opening        |      Inward      |     Outward     | Wastage   |      Balance
>        |-------------------------------------------------------------------------------------
>        |  cat.1  | Cat.2 |  cat.1  | Cat.2  |  cat.1  | Cat.2 |           |  cat.1  | Cat.2 |
> ---------------------------------------------------------------------------------------------
> 

>
> warm regards,
> mk.
>
>
>
> > Filters are always slow even very slow on big files. i have not seen what u wrote. but i suggest just make cursor rather than filtering tables that will faster. and can u brief us what u wana achieve with this table? might there is shorter version there..
> >
> >
> > Anil
> >
> > My Blog



Hello MK,

I agree with Anil. Instead of reusing the tables again and again, it is simpler to create a new cursor out of that. Also with cursor, you can immediately create it only with your needs (just add the fields that is important to you), create a WHERE clause to include only the records that are needed, include ORDER BY to generate a sorted cursor, etc.

That is way much faster than using the table again (which will have all fields and all records) then later filtering it. Filtering also goes very slow depending on the number of records so avoid using it as much as you can.

Now to your need here, it would be very hard for us to study your codes considering that it is very long; so as much as we want to assist I am sure that most of us will simply skip trying to understand what you wanted to do here. So my suggestion is to simply create some sample data just like what Leonard Trevor later learns to do, then your expected output. And maybe we can do it step by step, not the whole expected output outright.



http://www.junblogs.com/
http://weblogs.foxite.com/sandstorm36/default.aspx
http://www.coderisland.com/forum/viewforum.php?f=10

ENTIRE THREAD

how to optimize/fast this Posted by mk sharma @ 7/13/2010 8:33:26 PM
RE: how to optimize/fast this Posted by Anil Sharma @ 7/13/2010 8:44:44 PM
RE: how to optimize/fast this Posted by mk sharma @ 7/13/2010 8:59:49 PM
RE: how to optimize/fast this Posted by Jun Tangunan @ 7/14/2010 3:17:33 AM
RE: how to optimize/fast this Posted by mk sharma @ 7/14/2010 8:18:12 AM
RE: how to optimize/fast this Posted by Jun Tangunan @ 7/14/2010 10:21:01 AM
RE: how to optimize/fast this Posted by Jun Tangunan @ 7/14/2010 10:59:55 AM
RE: how to optimize/fast this Posted by mk sharma @ 7/14/2010 11:58:18 AM
RE: how to optimize/fast this Posted by Jun Tangunan @ 7/14/2010 12:19:49 PM
RE: how to optimize/fast this Posted by Jun Tangunan @ 7/14/2010 12:23:28 PM
RE: how to optimize/fast this Posted by Binod Binani @ 7/14/2010 8:00:52 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/14/2010 10:40:06 PM
RE: how to optimize/fast this Posted by mk sharma @ 7/15/2010 8:36:51 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/15/2010 6:31:43 PM
RE: how to optimize/fast this Posted by mk sharma @ 7/16/2010 6:31:23 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/16/2010 6:59:23 AM
RE: how to optimize/fast this Posted by Samir H. @ 7/16/2010 7:43:23 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/16/2010 7:25:46 PM
RE: how to optimize/fast this Posted by mk sharma @ 7/16/2010 7:48:03 AM
RE: how to optimize/fast this Posted by tushar @ 7/16/2010 8:05:16 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/16/2010 7:30:36 PM
RE: how to optimize/fast this Posted by Binod Binani @ 7/15/2010 2:27:34 PM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/15/2010 6:30:23 PM
RE: how to optimize/fast this Posted by Binod Binani @ 7/17/2010 8:01:16 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/18/2010 7:30:27 PM
RE: how to optimize/fast this Posted by Binod Binani @ 7/19/2010 9:49:06 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/19/2010 3:03:16 PM
RE: how to optimize/fast this Posted by Samir H. @ 7/14/2010 3:51:21 AM