Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scan no running
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01418319
Message ID:
01418328
Vues:
51
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform