--- parser3/src/main/pa_table.C 2001/08/10 07:04:44 1.35 +++ parser3/src/main/pa_table.C 2001/11/05 11:46:29 1.40 @@ -2,10 +2,10 @@ Parser: table class. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexander Petrosyan (http://paf.design.ru) - Author: Alexander Petrosyan (http://design.ru/paf) + $Id: pa_table.C,v 1.40 2001/11/05 11:46:29 paf Exp $ */ -static const char *RCSId="$Id: pa_table.C,v 1.35 2001/08/10 07:04:44 parser Exp $"; #include @@ -35,17 +35,18 @@ int Table::column_name2index(const Strin if(fcolumns) {// named int result=name2number.get_int(column_name)-1; // -1 = column not found if(bark && result<0) - THROW(0, 0, + throw Exception(0, 0, &column_name, "column not found"); return result; } else { // nameless - char *error_pos=0; - int result=(int)strtol(column_name.cstr(), &error_pos, 0); - if(error_pos && *error_pos) { - result=-1; // calm, compiler + char *error_pos; + const char *cstr=column_name.cstr(); + int result=(int)strtol(cstr, &error_pos, 0); + if(*error_pos/*not EOS*/) { + result=-1; if(bark) - THROW(0, 0, + throw Exception(0, 0, &column_name, "invalid column number"); }