Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select command to highlight missing Numbers
Message
From
22/04/2008 12:42:20
 
 
To
22/04/2008 11:48:34
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01311939
Message ID:
01312420
Views:
13
>I'm going to give that a try. I like this approach, as defining the gaps is my desired result. Unfortunately, this is the smallest of 8 tables that I need to look at.
>
>>Hmm, too bad. I never had to run it on more than about 40K records and worked fine there. Could you process the main file in smaller chunks?

Maybe this would work better, plain old xbase style code:
CREATE CURSOR gaps (gapstart i, gapend i)
SELECT sequence
GO TOP
nstart = nval - 1
nend = nstart
SCAN ALL
  IF nstart+1=nval
    nstart = nval
    LOOP
  ENDIF
  IF nstart<nval
    nstart = nstart + 1
    nend = nval - 1
  ENDIF
  INSERT INTO gaps VALUES (nstart,nend)
  nstart = nval
ENDSCAN
40K records takes about .08 seconds.
400K takes about .67 seconds.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform