internal string parseOptionNumber(String rtn)
{
string[] lines = StringUtils.split(rtn, StringUtils.CRLF);
if (lines[0] != "[Data]")
{
throw new UnexpectedDataException("Invalid return format (" + rtn + ")");
}
if (lines[1].StartsWith("[BEGIN_diERRORS]"))
{
throw new DataException(rtn.Substring(8));
}
if (lines.Length == 1)
{
throw new DataException("No option number data");
}
int p = lines[1].IndexOf(",^");
string optNum = lines[1].Substring(p + 2);
if (!StringUtils.isNumeric(optNum))
{
throw new UnexpectedDataException("Non-numeric option number");
}
return optNum;
}