Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scan with NO code, what does it do?
Message
De
08/05/2003 09:14:48
 
 
À
07/05/2003 13:41:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00785588
Message ID:
00786195
Vues:
21
Thanks for response. I did not write the code, just trying to understand it. My first prioroty is to make it a more robust multi-user system. Then I can optimeze it.

>>This is part of a set of screens that recieve vendor orders. What is meant to do is add addition records when a recieved order has items not ordered but which the client decides to keep any way. The constraints are that it MUST be on the list of items they can order form that vendor (in a seperate table) and is selected form a list of items not ordered from that vendor so the key always exists and so does the index.
>>
>>What I think the code is meant to do is find the last line of that particular order and then insert the additional item after it. The code it uses to this is
>>
>>SEEK Order_List.cordno
>>SCAN WHILE vitems.clordno = Order_List.cordno
>>ENDSCAN
>>SKIP -1
>>nMaxVLine = vitems.nvline + 1
>>SET ORDER TO TAG (cOldOrder) IN vitems
>>lnEstPrice	= Round(ThisForm.NRECQTY.Value*instock.npprice,2)
>>BEGIN TRANSACTION
>>APPEND BLANK IN vitems
>>REPLACE ...
>> .
>> .
>>
>
>Since the new record is inserted at the end anyway, this seems like overkill. If the goal is to find the maximum line number for that order, use code like:
>
>CALCULATE MAX(nvline) FOR vItems.clordno=Order_List.cordno
>
>As long as there's a tag on vItems.clordno, it's optimized. If, in fact, vItems is a view, then presumably it's a small record set and optimization won't matter.
>
>Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform