I ended up writing a parser for addresses separated by a semi-colon. Here is
the code for others with the same delema. It seems to work for what I need.
Of course this is in a loop that then address the addresses.

    P*--------------------------------------------------
    P* Procedure name: ParseEmailAddresses
    P* Purpose:        When a program passes multiple email addresses, this
    P*                          program will break them apart.
    P* Returns:        Array of Email Addresses
    P* Parameter:      ToParse => List of email addresses to parse
seperated
    P*                          by a semi-colon.
    P*--------------------------------------------------
    P ParseEmailAddresses...
    P                 B
    D ParseEmailAddresses...
    D                 PI         32700A
    D  toParse                   32767A   CONST

    D* Local fields
    D x               S              5P 0 Inz(1)
    D b               S              5P 0 Inz(0)
    D e               S              5P 0 Inz(0)
    D dim             S              3P 0 Inz(0)
    D retField        DS
    D  email                       100A   DIM(327)

     /free

       b = x;

       dow x < %len(toParse);

         if %subst(toParse:x) = ' ';
           leave;
         endif;

         if %subst(toParse:x:1) = ';';
           dim += 1;
           email(dim) = %trim(%subst(toParse:b:(x - b)));
           b = x + 1;
         endif;

         x += 1;

       enddo;

       dim += 1;
       email(dim) = %trim(%subst(toParse:b:(x - b)));

       return retField;

     /end-free
    P ParseEmailAddresses...
    P                 E


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2022 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.