Hi amos,
in my opinion this should not be changend in synapse.
From GetEmailDesc i expect a the description part of the address field.
If there is no description i expect an empty string. So everything is
fine with that function in this library. To implement your behavior, you
should do it in this way:
function AdvGetEmailDesc(Value: string; NonEmpty: boolean): string;
begin
Result := GetEmailDesc(Value);
if (Result = '') and (ReturnNonEmpty) then
Result := Value;
end;
Alex
amos schrieb:
> hi
>
> i suggest to add 2 new lines (see 2 last lines in the following function) to
> the following function, so in case the parameter
> includes only an email the result wont be an empty string, but the email
> itself. in order not to break backward behaviour,
> we can add a new parameter with default value FALSE (name of parameter can be
> changed). please let me know what
> do you think and whether you accept this fix. thanks.
>
> function GetEmailDesc(Value: string; ReturnNonEmpty: boolean = FALSE): string;
> var
> s: string;
> begin
> Value := Trim(Value);
> s := SeparateRight(Value, '"');
> if s <> Value then
> s := SeparateLeft(s, '"')
> else
> begin
> s := SeparateLeft(Value, '<');
> if s = Value then
> begin
> s := SeparateRight(Value, '(');
> if s <> Value then
> s := SeparateLeft(s, ')')
> else
> s := '';
> end;
> end;
> Result := Trim(s);
> if (Result = '') and (ReturnNonEmpty) then
> Result := Value;
> end;
>
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> synalist-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/synalist-public
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public