Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #8736 > unrolled thread
| Started by | Mark <markjotika@gmail.com> |
|---|---|
| First post | 2015-11-27 03:56 -0800 |
| Last post | 2015-11-29 10:49 +0100 |
| Articles | 7 — 7 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
Email Validation Mark <markjotika@gmail.com> - 2015-11-27 03:56 -0800
Re: Email Validation "Wolfgang Riedmann" <wriedmann@gmail.com> - 2015-11-27 14:07 +0100
Re: Email Validation Franz Rachbauer <office@rachbauer.org> - 2015-11-27 16:17 +0100
Re: Email Validation Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2015-11-27 19:06 +0100
Re: Email Validation "Willie Moore" <williem@wmconsulting.com> - 2015-11-27 15:16 -0600
Re: Email Validation sherlocksoftware@gmail.com - 2015-11-27 16:39 -0800
Re: Email Validation "Gerhard Bunzel" <g.bunzel@domonet.de> - 2015-11-29 10:49 +0100
| From | Mark <markjotika@gmail.com> |
|---|---|
| Date | 2015-11-27 03:56 -0800 |
| Subject | Email Validation |
| Message-ID | <8decdb10-8954-43bf-8e6b-7f19e8ae32b3@googlegroups.com> |
I have a single line edit for an email address. Does any one know of a good email validation i can use.
[toc] | [next] | [standalone]
| From | "Wolfgang Riedmann" <wriedmann@gmail.com> |
|---|---|
| Date | 2015-11-27 14:07 +0100 |
| Message-ID | <dbr2siFpabcU1@mid.individual.net> |
| In reply to | #8736 |
Hi Mark, > I have a single line edit for an email address. Does any one know of > a good email validation i can use. if you can implement regular expressions, then you will find a lot of expressions for this. Wolfgang --
[toc] | [prev] | [next] | [standalone]
| From | Franz Rachbauer <office@rachbauer.org> |
|---|---|
| Date | 2015-11-27 16:17 +0100 |
| Message-ID | <n39s6g$qbu$1@speranza.aioe.org> |
| In reply to | #8736 |
Hi Mark, here are examples in C# and VB, if you find someone who compiles it into DLL you can use it in VO: https://msdn.microsoft.com/en-us/library/01escwtf%28v=vs.110%29.aspx Regards Am 27.11.2015 um 12:56 schrieb Mark: > I have a single line edit for an email address. Does any one know of a good email validation i can use. >
[toc] | [prev] | [next] | [standalone]
| From | Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> |
|---|---|
| Date | 2015-11-27 19:06 +0100 |
| Message-ID | <1s5h5bl47cni7r2qa7n3dm2vcdrl00i61i@4ax.com> |
| In reply to | #8738 |
Franz,
if anyone doubts Regex are for crooked minds, this maybe a valid proof
<g>
Had it translated into VN, but keep getting a "unexpected token ")("
in the regex expression definition.
Decided to stop further investigation, before i'd get, as my son would
say, "eye-cancer"...
Karl
>Hi Mark,
>here are examples in C# and VB, if you find someone who compiles it into
>DLL you can use it in VO:
>
>https://msdn.microsoft.com/en-us/library/01escwtf%28v=vs.110%29.aspx
>
>Regards
>
>Am 27.11.2015 um 12:56 schrieb Mark:
>> I have a single line edit for an email address. Does any one know of a good email validation i can use.
>>
[toc] | [prev] | [next] | [standalone]
| From | "Willie Moore" <williem@wmconsulting.com> |
|---|---|
| Date | 2015-11-27 15:16 -0600 |
| Message-ID | <n3ah6m$cln$2@speranza.aioe.org> |
| In reply to | #8736 |
Mark, Here is a link to a VS solution that has the code from the link Franz provided in c# and Vulcan. I tried just posting the prg but the newsgroup complained that I had lines greater than 79 characters so it would not let me post it directly. https://dl.dropboxusercontent.com/u/26130378/TestRegex.zip Regards, Willie Grafx Development Team "Mark" wrote in message news:8decdb10-8954-43bf-8e6b-7f19e8ae32b3@googlegroups.com... I have a single line edit for an email address. Does any one know of a good email validation i can use.
[toc] | [prev] | [next] | [standalone]
| From | sherlocksoftware@gmail.com |
|---|---|
| Date | 2015-11-27 16:39 -0800 |
| Message-ID | <734988c2-b87c-4243-94d8-cc0d92e754b4@googlegroups.com> |
| In reply to | #8736 |
snip[ I have a single line edit for an email address. Does any one know of a good email validation i can use. ]
This is what I use.. works fine. Call it direct and I call it via a FIELDSPEC for an SLE for validation. Also I store emails in Memo field these days and not text field. I have the field length set at 180 characters and not the 70 shown below. Clients can store say 3 or 4 emails separated by Semi-Colon ;.
CLASS EMAIL_FIELD INHERIT FIELDSPEC
METHOD Init() CLASS EMAIL_FIELD
SUPER:Init( HyperLabel{ #EMAIL_FIELD, "Email address up to 70 characters", "", "EMAIL_FIELD" }, "C", 70, 0 )
SELF:oHLValidation := HyperLabel{ #EMAIL_FIELD,, "You supply a VALID Email address up to 70 characters", '' }
SELF:SetValidation( {|x| EMAILCheck(x, NULL_STRING) } )
RETURN SELF
FUNCTION EMAILCheck( cEmailAddress AS STRING, cEmailOwner AS STRING ) AS LOGIC
LOCAL lValid := FALSE AS LOGIC
LOCAL nATT, nDOT, xx AS DWORD
LOCAL nATT1, nATT2, nSemi AS DWORD
LOCAL aEmailAddress := {} AS ARRAY
BEGIN SEQUENCE
IF Empty( cEmailAddress )
lValid := TRUE
BREAK
ENDIF
IF Occurs('@', cEmailAddress ) > 1
nATT1 := At( '@', cEmailAddress )
nATT2 := At( '@', SubStr(cEmailAddress,nATT1+1))
//
nSemi := At( ';', SubStr(cEmailAddress, nATT1, nATT2+1))
//
IF nSemi = 0
ErrorBox{, "Dual Email addresses detected and must separated without a SEMICOLON, ';'" + CRLF + ;
"Between each email address USE only a single ';'.. Semicolon to split them" + CRLF + CRLF + ;
"[ " + cEmailAddress + " ]" + IIF( ! Empty( cEmailOwner), CRLF + "Reference: ( " + cEmailOwner + ")", "" ) }:show()
BREAK
ENDIF
ENDIF
aEmailAddress := GetEmailAddresses( cEmailAddress )
//
FOR xx := 1 TO ALen(aEmailAddress)
nATT := At( '@', aEmailAddress[xx] )
IF nATT > 0
nDOT := At( '.', SubStr(aEmailAddress[xx], nATT+1 ))
//
IF nATT > 1 .AND. nDOT > 1 // Ok we have found an '@' and a '.' further on from the '@'
lValid := TRUE
ENDIF
ENDIF
lValid := IIF(Empty(aEmailAddress[xx]),TRUE, lValid)
//
IF ! lValid
ErrorBox{, "The Email address [" + aEmailAddress[xx] + "] is Invalid, need @ and DOT" + CRLF + ;
IIF( ! Empty( cEmailOwner), CRLF + CRLF + "Reference: ( " + cEmailOwner + ")", "" ) }:show()
ENDIF
NEXT
END SEQUENCE
//
RETURN lValid
=====
FUNCTION GetEmailAddresses( cString AS STRING ) AS ARRAY PASCAL
LOCAL aData := {} AS ARRAY
LOCAL xx, nTilde AS DWORD
LOCAL cSemiColon AS STRING
cSemiColon := AllTrim( cString )
cSemiColon := StrTran( cSemiColon, ',', ';' )
cSemiColon := StrTran( cSemiColon, ':', ';' )
cSemiColon := StrTran( cSemiColon, ';', '|' )
cSemiColon := StrTran( cSemiColon, ';' + _CHR(32), '|' )
//
FOR xx := 1 TO SLen(cSemiColon)
nTilde := At('|', cSemiColon)
IF nTilde = 0
cString := StrTran(cSemiColon,";")
cString := StrTran(cString,_CHR(32))
cString := IIF( Right(cString,1) = ".", SubStr(cString,1,SLen(cString)-1), cString )
AAdd( aData, cString )
EXIT
ELSE
cString := StrTran(SubStr(cSemiColon,1,nTilde - 1),";")
cString := StrTran(cString,_CHR(32))
cString := IIF( Right(cString,1) = ".", SubStr(cString,1,SLen(cString)-1), cString )
AAdd( aData, cString)
ENDIF
cSemiColon := SubStr(cSemiColon, nTilde + 1)
NEXT
//
RETURN aData
[toc] | [prev] | [next] | [standalone]
| From | "Gerhard Bunzel" <g.bunzel@domonet.de> |
|---|---|
| Date | 2015-11-29 10:49 +0100 |
| Message-ID | <n3ehnk$k9d$1@news.m-online.net> |
| In reply to | #8736 |
Mark,
I do this simple check for a single mail address:
cAddress := AllTrim(SELF:oDCeMail:TextValue)
IF SLen(cAddress) > 5 .AND. At2("@", cAddress) > 1 .AND. At2(".", cAddress)
> 1 .AND. At2(" ", cAddress) == 0
.....
HTH
Gerhard Bunzel
"Mark" schrieb im Newsbeitrag
news:8decdb10-8954-43bf-8e6b-7f19e8ae32b3@googlegroups.com...
I have a single line edit for an email address. Does any one know of a good
email validation i can use.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web