Changeset 2268 in Sophya for trunk/SophyaPI/PIext/basexecut.cc
- Timestamp:
- Nov 15, 2002, 10:37:01 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r2265 r2268 804 804 } 805 805 } 806 else if (kw == "arrtoascii") { 807 if(tokens.size() < 2) { 808 cout<<"Usage: arrtoascii array_name file_name "<<endl; 809 return(0); 810 } 811 812 AnyDataObj* obj; 813 obj = mObjMgr->GetObj(tokens[0]); 814 if(obj == NULL) { 815 cerr << "arrtoascii Error , No such object " << tokens[0] << endl; 816 return(0); 817 } 818 BaseArray* ba = dynamic_cast<BaseArray *>(obj); 819 if(ba == NULL) { 820 cerr << "arrtoascii Error " << tokens[0] << " not a BaseArray ! " << endl; 821 return(0); 822 } 823 ofstream os(tokens[1].c_str()); 824 ba->WriteASCII(os); 825 cout << "arrtoascii: Array " << tokens[0] << " written to file " << tokens[1] << endl; 826 } 827 806 828 #endif 807 829 … … 1235 1257 usage = "Reads a matrix from an ASCII file (TMatrix<r_8>)"; 1236 1258 usage += "\n Usage: mtxfrascii mtx_name file_name"; 1237 usage += "\n Related commands: vecfrascii ntfrascii ";1259 usage += "\n Related commands: arrtoascii vecfrascii ntfrascii "; 1238 1260 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 1239 1261 kw = "vecfrascii"; 1240 usage = "Reads a v actor from an ASCII file (TVector<r_8>)";1262 usage = "Reads a vector from an ASCII file (TVector<r_8>)"; 1241 1263 usage += "\n Usage: vecfrascii vec_name file_name"; 1242 usage += "\n Related commands: mtxfrascii ntfrascii "; 1264 usage += "\n Related commands: arrtoascii mtxfrascii ntfrascii "; 1265 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 1266 kw = "arrtoascii"; 1267 usage = "Writes an array (TArray<T>) to an ASCII file "; 1268 usage += "\n Usage: arrtoascii array_name file_name"; 1269 usage += "\n Related commands: mtxfrascii vecfrascii ntfrascii "; 1243 1270 mpiac->RegisterCommand(kw, usage, this, "FileIO"); 1244 1271 #endif
Note:
See TracChangeset
for help on using the changeset viewer.