Try StrToInt(Edt2.text); ... except on Exception: EConvertError do ShowMessage('Введите правильно число!');