Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Small .prg slows network
Message
De
14/11/1997 13:42:21
 
 
À
14/11/1997 12:50:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00060184
Message ID:
00060312
Vues:
40
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform