bool ParseAddressList(ref string sBodyStruct, ref string sString)
{
sString = "";
// remove any spaces at the beginning and the end
sBodyStruct = sBodyStruct.Trim();
// check if this is NIL
if (IsNilString(ref sBodyStruct))
return true;
// remove the opening paranthesis
if (!FindAndRemove( ref sBodyStruct, '('))
return false;
// process each address
string sAddress = "";
while (sBodyStruct[0] == '(')
{
// Get each address in the list
if (!ParseAddress(ref sBodyStruct, ref sAddress))
{
return true;
}
// prepare the address list (as comma separated
// list of addresses).
if (sAddress.Length > 0)
{
if (sString.Length > 0)
sString += ", ";
sString += sAddress;
}
sBodyStruct = sBodyStruct.Trim();
}
// remove the closing paranthesis
return FindAndRemove( ref sBodyStruct, ')');
}