Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to make this code faster
Message
De
02/05/2013 13:52:18
 
 
À
02/05/2013 13:37:30
Mk Sharma
Shrishti Solutions
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01572484
Message ID:
01572520
Vues:
41
I would like to help you but I'm pressed for time today.

I think setting the relationships and doing the IIF() comparison will yield better results. You have some unusual dependencies here though, which I'm not sure about. I'd like to see about getting a small set of your data and then being able to validate against the slow function which is working, against any optimized versions.

Best regards,
Rick C. Hodgin


>Little change in my code and it is taking little less time.
>
>How to do below code with REPLACE ?
>
>
>Local lcmasterid, lnavgrec1, lnavgrec2, lnavgrec3, lnpackno, lntakano, lntotrec, lntrnno
>USEFILE('cuttm')
>USEFILE('cuttct')
>USEFILE('packtc')
>lntakano = 0
>Select cuttm
>Set Order To takano
>Select cuttct
>Set Order To takano
>Select packtm
>Set Order To MASTERID
>Select packtc
>Set Order To takano
>Select cuttct
>
>Wait Window 'Working... Taka... Please Wait...' At Srows() / 2, Scols() / 2  Nowait
>
>Select cuttct
>Scan For Not Empty(takano)    && Created a BINARY index on empty(takano)
>   lntakano = takano
>   Do Case
>      Case Seek(m.lntakano, 'packtc', 'takano')
>         If Seek(packtc.MASTERID, 'packtm', 'masterid')
>            lnpackno = packtm.packno
>			Replace	;
>					packed With	Iif(m.lnpackno <> 0, 'Y', ' ') ;
>					packno With	m.lnpackno ;
>					recuttno  With 0  ;
>				In cuttct
>         Endif
>      Case Seek(m.lntakano, 'cuttm', 'takano')
>         lntrnno =	cuttm.trnno
>         Replace packed With Iif(m.lntrnno <> 0, 'Y', ' '), packno With 0, recuttno With m.lntrnno In cuttct
>      Case Seek(m.lntakano, 'cuttm', 'takano1')
>         lntrnno =	cuttm.trnno
>         Replace packed With Iif(m.lntrnno <> 0, 'Y', ' '), packno With 0, recuttno With m.lntrnno In cuttct
>      Otherwise
>         Replace packed With ' ', packno With 0, recuttno With 0 In cuttct
>   Endcase
>Endscan
>Wait Clear
>
>
>
>Warm regards,
>mk.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform