corretto comportamento dell' operatore [,] (mid)

git-svn-id: svn://10.65.10.50/trunk@303 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1994-10-03 09:50:32 +00:00
parent 5df8cfc13b
commit fb0ebca1cc

View File

@ -837,13 +837,7 @@ bool TExpression::compile(const char* expression, TTypeexp type)
else
{
const int n2 = atoi(s2);
// if (n1 == 0) sc << format(" right(%s,%d)", _tok, n2);
// else
// if (n2 == 0) sc << format(" left(%s,%d)", _tok, n1);
// else
if (n2 == 0) sc << format(" mid(%s,%d,0)", _tok, n1);
else
sc << format(" mid(%s,%d,%d)", _tok, n1, n2 - n1 + 1);
sc << format(" mid(%s,%d,%d)", _tok, n1, (n2 < n1) ? -1 : n2 - n1 + 1);
}
}
}