Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Email validation
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00508552
Message ID:
00508558
Views:
30
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform