\r
/***********************************************************************/\r
\r
-void ReadColumnMatrix::read(NameAssignment* nameMap){\r
+int ReadColumnMatrix::read(NameAssignment* nameMap){\r
try { \r
\r
string firstName, secondName;\r
//need to see if this is a square or a triangular matrix...\r
\r
while(fileHandle && lt == 1){ //let's assume it's a triangular matrix...\r
+\r
\r
fileHandle >> firstName >> secondName >> distance; // get the row and column names and distance\r
+ \r
+ if (m->control_pressed) { fileHandle.close(); delete reading; return 0; }\r
\r
map<string,int>::iterator itA = nameMap->find(firstName);\r
map<string,int>::iterator itB = nameMap->find(secondName);\r
\r
if(itA == nameMap->end()){\r
- cerr << "AAError: Sequence '" << firstName << "' was not found in the names file, please correct\n";\r
+ cerr << "AAError: Sequence '" << firstName << "' was not found in the names file, please correct\n"; exit(1);\r
}\r
if(itB == nameMap->end()){\r
- cerr << "ABError: Sequence '" << secondName << "' was not found in the names file, please correct\n";\r
+ cerr << "ABError: Sequence '" << secondName << "' was not found in the names file, please correct\n"; exit(1);\r
}\r
\r
if (distance == -1) { distance = 1000000; }\r
\r
while(fileHandle){\r
fileHandle >> firstName >> secondName >> distance;\r
+ \r
+ if (m->control_pressed) { fileHandle.close(); delete reading; return 0; }\r
\r
map<string,int>::iterator itA = nameMap->find(firstName);\r
map<string,int>::iterator itB = nameMap->find(secondName);\r
gobble(fileHandle);\r
}\r
}\r
-\r
+ \r
+ if (m->control_pressed) { fileHandle.close(); delete reading; return 0; }\r
+ \r
reading->finish();\r
fileHandle.close();\r
\r
list->setLabel("0");\r
+ \r
+ return 1;\r
\r
}\r
catch(exception& e) {\r
- errorOut(e, "ReadColumnMatrix", "read");\r
+ m->errorOut(e, "ReadColumnMatrix", "read");\r
exit(1);\r
}\r
}\r