private int[] pGetPagesToPrint(String pagesToPrint)
{
String[] v = null;
int[] n = null;
String[] v2 = null;
int t = 0;
int r = 0;
bool addInterval = false;
v = pagesToPrint.Split(',');
G.redim(ref n, 0);
for (int i = 0; i < v.Length; i++)
{
int k = v[i].IndexOf("-", 1);
if (k > 0)
{
v2 = v[i].Split('-');
addInterval = false;
for (t = 0; t < v2.Length; t++)
{
if (G.isNumeric(v2[t]))
{
if (addInterval)
{
for (r = n[n.Length - 1] + 1; r <= int.Parse(v2[t]) - 1; r++)
{
G.redimPreserve(ref n, n.Length + 1);
n[n.Length - 1] = r;
}
}
else
{
addInterval = true;
}
G.redimPreserve(ref n, n.Length + 1);
n[n.Length - 1] = int.Parse(v2[t]);
}
}
}
else
{
if (G.isNumeric(v[i]))
{
G.redimPreserve(ref n, n.Length + 1);
n[n.Length - 1] = int.Parse(v[i]);
}
}
}
return n;
}