Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Small .prg slows network
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00060184
Message ID:
00060330
Vues:
29
>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
>***********************************************************
Larry,

Ok you ahve a loop running very fast and in that loop you are performing an INSERT which hit the fiel server and then a REPLACE which hits the fileserver. This code is firing rapid fire and it is occupying the band width of the netowrk cable as well as taxing the file server too. You have a choice, you can keep this prg running super fast like it is and let everyone else wait till it is done, or you can slow this prg down by putting an INKEY(.5,"H") right after the replace to pause 1/2 second after each pass through the loop. This pause will allow others to get into the server for their stuff in between passes through your loop.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform