Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Email validation
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00508552
Message ID:
00508558
Vues:
29
Hi Daniel,
I'll take a shot at it
function IsEmail()
** Checks to see if there is an "@", a "." and 
** characters for name, domain and extension
lparameters cEMail
local lRet, nAt, nDot

cEmail = allt(cEMail)  && trim if entered from a textbox

lRet = .f.
nAt = at('@', cEMail)
nDot = at('.', cEMail)
if nAt > 1 .and. nDot > nAt+1 .and. len(cEMail)> nDot
   lRet = .t.
endif

return lRet
You can add more checks to see if the last 3 characters are valid also. Of course you can tighten the code by including the at() functions in a single iif() statement, but it's easier to read this way.

HTH
Barbara

>Hello everyone:
>
>I need an algorithm to determine whether an email address is well-formed. A validation function would be even better!
>
>Daniel
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform