Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need Scan..EndScan code help
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00166652
Message ID:
00166777
Views:
24
>Here's the problem with the code that has been posted;
>
>
>SELECT Customer
>...
>SCAN WHILE ...
>   SELECT Otemp
>   ...
>   SELECT Collat
>   ...
>   SELECT oTemp
>ENDSCAN
>
>
>This code first selects customer and starts a scan loop, at the end of the loop it selects oTemp, but the ENDSCAN selects customer again. The record pointer is never moving in oTemp so teh same record gets processed over and over again until the customer hits a record that fails the WHILE clause. Also the same record in Collat is hit with an update from the same oTemp record for every customer record.

OK. Now I am confused because she had a Locate statement that should have moved the pointer in oTemp.
SELECT customer
SET ORDER TO TAG cid_cseq
SCAN WHILE cust_id = m.cust_id
      SELECT oTemp
      LOCATE FOR cust_seq = customer.cust_seq
      SCATTER MEMVAR MEMO
      SELECT collat
      GATHER MEMVAR MEMO
ENDSCAN
Since Customer is the table scanned and is implicitly selected at ENDSCAN, should not the pointer in customer be moving to the next record each iteration? Thus potentially changing the cust_seq being searched for. oTemp is the table being searched by the locate command.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform