numbervar isn; //check for null/blank email addresses
IF {@nullcheck}=1 then isn := 9 else isn := 0;
numbervar ats; //check that there is at least one @ symbol
IF {@nullcheck}=1 then 1 else IF instr({personnel.email},"@")>0 then ats := 0 else ats := 1;
numbervar uba; //check that there is not more than 1 @ symbol
IF {@nullcheck}=1 then 1 else IF ubound(split({personnel.email},"@"))>2 then uba := 1 else uba := 0;
numbervar ata; //check that the email does not begin with an invalid character (list needs revision)
IF {@nullcheck}=1 then 1 else IF NOT(LEFT({personnel.email},1) IN ["@","/","?",".","-","=","+","<",">",";","'","[","]","\","|","`","~","!","#","$","%","^","&","*","(",")","_"])
then ata := 0 else ata := 1;
numbervar enp; //check that there is a . in the last 4 characters
IF {@nullcheck}=1 then enp := 1 else IF (instr(RIGHT({personnel.email},4),".")>0) then enp := 0 else enp := 1;
numbervar ate; //check that the email does not end with an invalid character (list needs revision)
IF {@nullcheck}=1 then ate := 1 else IF NOT(RIGHT({personnel.email},1) IN ["@",".","-","=","+","<",">",";","'","[","]","\","|","`","~","!","#","$","%","^","&","*","(",")","_"])
then ate := 0 else ate := 1;
numbervar ivc := 0; //check for invalid characters throughtout email
stringvar ivn ;
numbervar ivl := len({personnel.email});
numbervar ivu := 1;
IF NOT({@nullcheck}=1) then
While ivu < ivl OR ivu = ivl DO
( ivn := {personnel.email}[ivu];
IF ivn in ["=","+","<",">",";","'","[","]","\","/","|","`","~","!","#","$","%","^","&","*","(",")"]
then ivc := ivc + 1 else ivc := ivc;
ivu := ivu + 1;
ivc );
ivc;
totext(isn+ats+uba+ata+enp+ate+ivc,0) & " - " & totext(isn,0) & " " & totext(ats,0) & " " & totext(uba,0)
& " " & totext(ata,0) & " " & totext(enp,0) & " " & totext(ate,0) & " " & totext(ivc,0)