I have put a Email Address textbox in the Registration Information screen for my setup project.
How do I validate it?
Simple rules like someone@company.com is enough.
must have @ and .
Thank you!
Valdating Email Address
This is a bit simplistic (doesn't check for invalid characters) but try:
Set Variable EMAILFAIL to TRUE
Set Variable EMAILNAME to
Set Variable EMAILDOMAIN to
Comment: Check for invalid space character (pattern in next statement is a space)
Parse String $EMAIL$ into Variables EMAILNAME and EMAILDOMAIN (Split at first occurrence of pattern)
if Variable EMAILDOMAIN Equals
Comment: Check for strings on each side of the asterisk (pattern in next Parse String is an asterisk)
Parse String $EMAIL$ into Variables EMAILNAME and EMAILDOMAIN (Split at first occurrence of pattern)
if Variable EMAILNAME not Equals
if Variable EMAILDOMAIN not Equals
Comment: Check for a period in the domain (pattern in next Parse String is a period)
Set Variable EMAILDOMAIN_1 to
Set Variable EMAILDOMAIN_2 to
Parse String $EMAILDOMAIN$ into Variables EMAILDOMAIN_1 and EMAILDOMAIN_2 (Split at last occurrence of pattern)
if Variable EMAILDOMAIN_1 not Equals
if Variable EMAILDOMAIN_2 not Equals
Set Variable EMAILFAIL to FALSE
end
end
end
end
end
if Variable EMAILFAIL Equals True
Comment: Take action on the invalid e-mail address
end
Where $EMAIL$ is the variable containing the email address to test.
Set Variable EMAILFAIL to TRUE
Set Variable EMAILNAME to
Set Variable EMAILDOMAIN to
Comment: Check for invalid space character (pattern in next statement is a space)
Parse String $EMAIL$ into Variables EMAILNAME and EMAILDOMAIN (Split at first occurrence of pattern)
if Variable EMAILDOMAIN Equals
Comment: Check for strings on each side of the asterisk (pattern in next Parse String is an asterisk)
Parse String $EMAIL$ into Variables EMAILNAME and EMAILDOMAIN (Split at first occurrence of pattern)
if Variable EMAILNAME not Equals
if Variable EMAILDOMAIN not Equals
Comment: Check for a period in the domain (pattern in next Parse String is a period)
Set Variable EMAILDOMAIN_1 to
Set Variable EMAILDOMAIN_2 to
Parse String $EMAILDOMAIN$ into Variables EMAILDOMAIN_1 and EMAILDOMAIN_2 (Split at last occurrence of pattern)
if Variable EMAILDOMAIN_1 not Equals
if Variable EMAILDOMAIN_2 not Equals
Set Variable EMAILFAIL to FALSE
end
end
end
end
end
if Variable EMAILFAIL Equals True
Comment: Take action on the invalid e-mail address
end
Where $EMAIL$ is the variable containing the email address to test.
... Fig
Thanks a lot Fig. It really helps!
btw, the pattern in the 2nd parse should be: "@"
btw, the pattern in the 2nd parse should be: "@"
Fig wrote:This is a bit simplistic (doesn't check for invalid characters) but try:
Set Variable EMAILFAIL to TRUE
Set Variable EMAILNAME to
Set Variable EMAILDOMAIN to
Comment: Check for invalid space character (pattern in next statement is a space)
Parse String $EMAIL$ into Variables EMAILNAME and EMAILDOMAIN (Split at first occurrence of pattern)
if Variable EMAILDOMAIN Equals
Comment: Check for strings on each side of the asterisk (pattern in next Parse String is an asterisk)
Parse String $EMAIL$ into Variables EMAILNAME and EMAILDOMAIN (Split at first occurrence of pattern)
if Variable EMAILNAME not Equals
if Variable EMAILDOMAIN not Equals
Comment: Check for a period in the domain (pattern in next Parse String is a period)
Set Variable EMAILDOMAIN_1 to
Set Variable EMAILDOMAIN_2 to
Parse String $EMAILDOMAIN$ into Variables EMAILDOMAIN_1 and EMAILDOMAIN_2 (Split at last occurrence of pattern)
if Variable EMAILDOMAIN_1 not Equals
if Variable EMAILDOMAIN_2 not Equals
Set Variable EMAILFAIL to FALSE
end
end
end
end
end
if Variable EMAILFAIL Equals True
Comment: Take action on the invalid e-mail address
end
Where $EMAIL$ is the variable containing the email address to test.
Who is online
Users browsing this forum: No registered users and 131 guests