diff -r 32b71ba642aa -r 53ef954e90b6 parser.cpp --- a/parser.cpp Fri Jun 29 15:12:04 2007 +0000 +++ b/parser.cpp Wed Jan 16 15:45:19 2008 +0000 @@ -191,6 +191,27 @@ return true; } +bool Parser::checkParIsDouble(const int &index) +{ + bool ok; + if (index > paramList.count()) + { + errLevel=Aborted; + errDescription=QString("Parameter index %1 is outside of parameter list").arg(index); + return false; + } else + { + paramList[index].toDouble (&ok); + if (!ok) + { + errLevel=Aborted; + errDescription=QString("Parameter %1 is not double").arg(index); + return false; + } + } + return true; +} + int Parser::parInt (bool &ok,const uint &index) { if (checkParIsInt (index)) @@ -246,6 +267,14 @@ return c; } +double Parser::parDouble (bool &ok,const int &index) +{ + if (checkParIsDouble (index)) + return paramList[index].toDouble (&ok); + ok=false; + return 0; +} + void Parser::setScript(const QString &s) { script=s;