Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scan Endscan Return Value
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00592235
Message ID:
00592506
Vues:
17
Hi Mark,

Thanks for your reply.

Unfortunately my actual case would be difficult to reproduce. I just spent an hour or so trying to use your routine here and agree, I could not reproduce. In my situation I had set multilocks on and set reprocess to 1. The test where I returned false was on "IF !rlock()" and I thought that might have something to do with it. With my actual code, the value of the key for the locked record was returned instead of false.

Anyway, I tried all the obvious possibilities using a more simple test case and could not recreate. I am sure there is something else in this equation, but it escapes me at this time.

Thanks for your time.

-Nancy

>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform