Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scan no running
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01418319
Message ID:
01418337
Views:
40
>>>>The scan below is not running
>>>>
>>>>SELECT email_anexo
>>>>
>>>> SCAN
>>>>
>>>> thisform.refresh
>>>> LOCATE FOR emails.cod = email_anexo.id
>>>>
>>>> IF FOUND()
>>>> replace email_anexo.spam with .F.
>>>> ELSE
>>>> replace email_anexo.spam with .T.
>>>> ENDIF
>>>>
>>>> ENDSCAN
>>>
>>>Why do you need SCAN?
>>>
>>>replace spam with (NOT email_anexo.id == emails.cod) IN email_anexo
>>>
>>
>>Do you want REPLACE ALL here?
>
>Did I?
>No, but the code want it (or at least what I think the code want)
>Stay aside of the EOF status when the MAIL is NOT found.

Looking at the code itself it looked like he wanted to replace all records in Email_Anexo table with .F./T. depending on found/not found status.

But in fact I think he wanted to scan the Emails table instead, e.g. we should have used UPDATE command with LEFT JOIN and NVL. That's what I suspect was the intent, but better wait for Moises clarification here.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform