Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Small .prg slows network
Message
From
14/11/1997 13:42:21
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00060184
Message ID:
00060312
Views:
31
the objective is to count number of (active) people
in each district / age_group

***********************************************************
CLOS ALL
CLEA ALL
CLEA

SET EXCL OFF
SET TALK OFF
SET ESCA ON
SET SAFE OFF
SET DELE ON

USE MasterFile
COPY STRU TO CountFile

SELECT 0
USE CountFile EXCL
INDEX ON DISTRICT + AGEGRP TAG DISTRICT

SELECT MasterFile
nCount = 0
SCAN
nCount = nCount + 1
@ 05,02 SAY nCount
*
IF INACTIVE <> 'Y'
cAgeGrp = AGEGRP
cDistrict = DISTRICT
*
* increment total
IF ! SEEK(cDistrict + cAgeGrp,"CountFile","District")
INSERT INTO CountFile (DISTRICT,AGEGRP) VALUES (cDistrict, cAgeGrp)
ENDIF
REPLACE TOTAL WITH TOTAL + 1 IN CountFile
ENDIF
ENDSCAN
***********************************************************
Have you tried to do a SELECT statement instead??? I would fathom a guess that it may be a little faster and less of a server hog than your current code.
Previous
Reply
Map
View

Click here to load this message in the networking platform