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:
01418328
Views:
52
>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


Do you want your replace for only one particular Emails.Cod?

If yes, then
lcCode = emails.Code

update Email_Anexo set Spam = .F. where exists (select 1 from Email_Anexo EA where ID = lcCode and ID = Email_Anexo.ID)
update Email_Anexo set Spam = .T. where not exists (select 1 from Email_Anexo EA where ID = lcCode and ID = Email_Anexo.ID)
Or simply
update EMail_Anexo set Spam = .F. where ID = lcCode
update EMail_Anexo set Spam = .T. where ID <> lcCode
Finally, using Borislav's idea simply
replace all Spam with ID <> lcCode in Email_Anexo
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform