I can not reproduce this in 6 or 7. Can you post some code that you have run that will repro this? For example, the following code is what I ran on 2 of my tables, but I get no bogus return error. I get FALSE as the return value.
luRetVal = ScanTest()
?
?
? luRetVal
PROCEDURE ScanTest
CLOSE ALL
USE invbkup
USE mnubkup IN 0
lnKount = 1
SCAN
SELECT mnubkup
lnKount = lnKount + 1
SCAN
IF lnKount = 1000
RETURN .f.
ENDIF
ENDSCAN
ENDSCAN
>This message is to document something that is occurring in VFP 6.0 so that others will not be stumped by this same problem. I have not yet tested it in 7.0.
>
>I have a method where I do SCAN .. ENDSCAN on table A
>
>Within that SCAN loop I do another SCAN .. ENDSCAN on table B
>
>Given a certain condition within the inner SCAN, I return .F. This was the problem. I should have exited both scan loops prior to the return. When I did that the problem was solved.
>
>When I had the return in the scan, VFP let me return, but the return value was incorrect. Instead of returning the correct logical value, it returned the value of the key for the table and record it was scanning.
>
>Since Return is not one of the allowed options within a scan, I do not consider this a bug. However, I have posted this here in the event that it may be helpful to someone else.
>
>-Nancy
Mark McCasland
Midlothian, TX USA