X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mothurout.cpp;h=dfcf25b4447d28362dae3f27a4e9cfd27e362d8e;hb=0cefb55a2616975bd4a144fc345693695ffc9bb6;hp=14840c16e162bc599c242e289e3c5899fb396de4;hpb=2ecee16fec29d4c525f740ec19b27962ca09c050;p=mothur.git diff --git a/mothurout.cpp b/mothurout.cpp index 14840c1..dfcf25b 100644 --- a/mothurout.cpp +++ b/mothurout.cpp @@ -2017,6 +2017,28 @@ bool MothurOut::mothurConvert(string item, int& num){ exit(1); } } +/***********************************************************************/ +bool MothurOut::mothurConvert(string item, intDist& num){ + try { + bool error = false; + + if (isNumeric1(item)) { + convert(item, num); + }else { + num = 0; + error = true; + mothurOut("[ERROR]: cannot convert " + item + " to an integer."); mothurOutEndLine(); + commandInputsConvertError = true; + } + + return error; + } + catch(exception& e) { + errorOut(e, "MothurOut", "mothurConvert"); + exit(1); + } +} + /***********************************************************************/ bool MothurOut::isNumeric1(string stringToCheck){ try {