Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scan with NO code, what does it do?
Message
From
07/05/2003 10:59:50
 
 
To
07/05/2003 02:33:28
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00785588
Message ID:
00785829
Views:
34
First thank you to everyone who replied.

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 ...
 .
 .
FWIW it is a character key.

If that is correct then it sounds like last suggestion would be faster. Is that correct?

>>While checking forms for other problems I found the following code
>>
>>SELECT vitems
>>
>>cOldOrder = ORDER()
>>SET ORDER TO TAG ordkey
>>
>>SEEK Order_List.cordno
>>
>>SCAN WHILE vitems.clordno = Order_List.cordno
>>ENDSCAN
>>
>>What does it do?
>
>Moves the pointer to record where clordno is the following key of order_list.cordno in a slow way (thinking there might be many records with a particular key). ie: If there are clordno keys like 5 and 6 and current order_list.cordno is 5, moves pointer to first key with clordno=6 in vitems.
>(Code seems to assume Order_List.cordno exists in vitems)
>
>
>SELECT vitems
>cOldOrder = ORDER()
>SET ORDER TO TAG ordkey
>
>* Sounds to be a char key
>lcKey = Stuff(Order_List.cordno, ;
>  Len(Order_List.cordno), 1, ;
>  Chr(Asc(Right(Order_List.cordno,1))+1))
>* If integer: lnKey = lnKey + 1
>set near on
>SEEK lcKey
>set near off
>
>or
>
>SELECT vitems
>
>cOldOrder = ORDER()
>SET ORDER TO TAG ordkey desc
>*set near on && If key might not exist
>SEEK Order_List.cordno
>*set near off
>SET ORDER TO TAG ordkey ascending
>skip
>
>Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform