# HG changeset patch # User insilmaril # Date 1183547116 0 # Node ID be2299221801922dc81fc497b2b043cc54f72c4a # Parent 16d3598f611fb111550c565f543de2320024a5f9 Version 1.9.0 diff -r 16d3598f611f -r be2299221801 parser.cpp --- a/parser.cpp Wed Jul 04 11:05:15 2007 +0000 +++ b/parser.cpp Wed Jul 04 11:05:16 2007 +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;