Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FOUND() not working with table buffering and scatter/gat
Message
From
05/03/2002 15:47:15
 
 
To
01/03/2002 15:35:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00627159
Message ID:
00628646
Views:
15
Hi Sylvian,

I agree do while seek(... is a cleaner and safer way of doing it. The problem I'm having though is the seek() and found() are both returning .t. when they should be returning .f.. I've stepped throught the code in debug and after erasing the correct records, the program doesn't exit the loop because of the incorrect response. The table is buffer'd and set near and set exact are both off. What I'm going to do to fix this is use if/endif within the loop to verify the data after the seek() and exit the loop if appropriate, but I'd sure like to know if this is some kind of bug in Foxpro, or if I'm missing something obvious.

Thanks,
Larry



>PMFJI, I'd like to propose a little modification to your code. I'm not a big fan of DO WHILE .T. ... EXIT, so, here's how I would have done it:
>
>
select DispChek		
>set order to dispchek
>do while seek(lcDispatchNumber+DspCkItm.driver+lcdrvnum,'Dispchek','dispchek')
>    scatter memvar blank
>    gather memvar
>enddo
>
>I have not tested it, but from a quick look, I think it would do the same as your code.
>
>>Yes, that's what I intended to do. I just changed to program code, and it works. This is what I have now:
>>
>>select DispChek
>>set order to dispchek
>>do while .t.
>>    if seek(lcDispatchNumber+DspCkItm.driver+lcdrvnum,'Dispchek','dispchek')
>>        scatter memvar blank
>>        sather memvar
>>    else
>>        exit
>>    endif
>>enddo
Previous
Reply
Map
View

Click here to load this message in the networking platform