× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Nevermind me today... I was thinking it was looking for the last of 3 
chars to be not blank.  It's monday, I'm sorry I wasted everyone's time 
lol.  Looks fine to me now....

Ron Power
Programmer
Information Services
City Of St. John's, NL
P.O. Box 908
St. John's, NL
A1C 5M2
709-576-8132
rpower@xxxxxxxxxx
http://www.stjohns.ca/
___________________________________________________________________________
Success is going from failure to failure without a loss of enthusiasm. - 
Sir Winston Churchill




"Jonathan Mason" <jonathan.mason@xxxxxxxxxxxxxxxx> 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
2005/11/28 12:20 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
"'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: EMAIL Syntax Validation






Hi Ron

No, "// sym" would be equal to "ca " (the three characters after the "." 
in
the email address.

All that Tommy is testing for is that:

a) There is an "@" symbol in the email address.
b) There is a "." somewhere after the "@" symbol (there has to be for the
address to have a top level domain (.com, .org, .ca, etc).
c) There has to be something after the "." (it doesn't matter what because
the routine isn't validating that the address or domain exists, just that
the format looks right)

So "rpowers@xxxxxxxx" would be classed as valid, but "rpowers@home"
wouldn't.

All the best

Jonathan

-----Original Message-----
From: rpg400-l-bounces+jonathan.mason=astradyne-uk.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+jonathan.mason=astradyne-uk.com@xxxxxxxxxxxx] On
Behalf Of RPower@xxxxxxxxxx
Sent: 28 November 2005 15:41
To: RPG programming on the AS400 / iSeries
Subject: RE: EMAIL Syntax Validation

Sorry, I thought that returning *ON was invalid, my bad.  How about if we 
used rpower@xxxxxxxxxx

Pos=%Scan('@':EMail);  //rpower@ pos=7 
If Pos>0; 
  Pos=%Scan('.':Email:Pos); //stjohns. Pos=15
  If Pos>0; 
    If %Subst(Email:Pos+1:3)<>*Blanks; //sym is equal to blanks due to our 

.ca so it would skip this... am I correct?
      Return *On; 
    EndIf; 
  EndIf; 
EndIf; 
Return *OFF; //invalid email

Ron Power
Programmer
Information Services
City Of St. John's, NL
P.O. Box 908
St. John's, NL
A1C 5M2
709-576-8132
rpower@xxxxxxxxxx
http://www.stjohns.ca/
___________________________________________________________________________
Success is going from failure to failure without a loss of enthusiasm. - 
Sir Winston Churchill




"Holden Tommy" <Tommy.Holden@xxxxxxxxxxxxxxxxx> 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
2005/11/28 11:58 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
"RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: EMAIL Syntax Validation






 let's see...

Pos=%Scan('@':EMail);  //rpower@ pos=7 
If Pos>0; 
  Pos=%Scan('.':Email:Pos); //nf. Pos=10
  If Pos>0; 
    If %Subst(Email:Pos+1:3)<>*Blanks; //sym is not equal to blanks,
email is valid. 
      Return *On; 
    EndIf; 
  EndIf; 
EndIf; 

Return *OFF; //invalid email

Thanks,
Tommy Holden


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of RPower@xxxxxxxxxx
Sent: Monday, November 28, 2005 9:19 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: EMAIL Syntax Validation

I would think that that routine would find my home email address
invalid?

rpower@xxxxxxxxxxxxxxx

based on you substring for the first . after the @...??

Ron Power
Programmer
Information Services
City Of St. John's, NL
P.O. Box 908
St. John's, NL
A1C 5M2
709-576-8132
rpower@xxxxxxxxxx
http://www.stjohns.ca/
________________________________________________________________________
___
Success is going from failure to failure without a loss of enthusiasm. -

Sir Winston Churchill




"Holden Tommy" <Tommy.Holden@xxxxxxxxxxxxxxxxx> 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
2005/11/28 11:40 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
"RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: EMAIL Syntax Validation






Shouldn't be too hard for you to convert this to RPG 3...

Pos=%Scan('@':EMail); 
If Pos>0; 
  Pos=%Scan('.':Email:Pos); 
  If Pos>0; 
    If %Subst(Email:Pos+1:3)<>*Blanks; 
      Return *On; 
    EndIf; 
  EndIf; 
EndIf; 


Thanks,
Tommy Holden


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Bob Voltz
Sent: Monday, November 28, 2005 8:36 AM
To: RPG400-L@xxxxxxxxxxxx
Subject: EMAIL Syntax Validation


  Does anyone have an email syntax validation routine they could
post...or point me to a sample somewhere?  I just want to make sure it
is in a valid format.  I don't care if it is a valid address or if the
domain exists.  Oh....it also has to be in RPG III.....don't ask.....
 
  Thanks,
  Bob Voltz
 

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.