Index: trunk/SophyaProg/Tests/tnt.cc
===================================================================
--- trunk/SophyaProg/Tests/tnt.cc	(revision 2828)
+++ trunk/SophyaProg/Tests/tnt.cc	(revision 2832)
@@ -3,4 +3,5 @@
 #include <math.h>
 #include <iostream>
+#include <fstream>
 
 #include "sopnamsp.h"
@@ -31,5 +32,5 @@
     exit(0);
   }
-
+  int rc = 0;
   try {
     if (*arg[1] == 'd')  test_dvl();
@@ -42,11 +43,15 @@
   catch(PThrowable exc ) {
     cerr << "tnt-main() , Catched exception: \n" << exc.Msg() << endl;
+    rc = 97;
   }
   catch(std::exception ex) {
     cerr << "tnt-main() , Catched exception ! " << (string)(ex.what()) << endl;
+    rc = 98;
   }
   catch(...) {
     cerr << "tnt-main() , Catched ... ! " << endl;
-  }
+    rc = 99;
+  }
+  return rc;
 }
 
@@ -119,5 +124,8 @@
      << " ->double= " << (double)tv << " ->TimeStamp:" 
      << TimeStamp((double)tv).ToString() << endl;
-
+tv = "1995-09-23T15:20:32";
+string tts = (string)tv;
+cout << "MuTyV=TimeStamp tv=" << tv << " ->TimeStamp(tv)=" 
+     << TimeStamp(tts) << endl;
 
 cout << "\n\n ======= test_dvl:  Testing DVList ======= " << endl;
@@ -192,5 +200,9 @@
   dt.AddComplexColumn("cmplx_cos_sin");
   dt.AddDoubleComplexColumn("dcmplx_cos_sin");
+  dt.AddDateTimeColumn("datime");
   MuTyV rec[10];
+  TimeStamp ts("01/3/2005","0:0:0"); 
+  TimeStamp ts2(0.);
+  
   cout << " 1/ First 1000 lines .... " << endl;
   for(int k = 0; k<1000; k++) {
@@ -210,4 +222,6 @@
     rec[7] = complex<r_4>(cx, sx);
     rec[8] = complex<r_8>(cx, sx);
+    ts2.Set(ts.ToDays()+(double)k/24.);
+    rec[9] = ts2;
     dt.AddLine(rec);
   }
@@ -234,4 +248,6 @@
     rec[7] = complex<r_4>(cx, sx);
     rec[8] = complex<r_8>(cx, sx);
+    ts2.Set(ts.ToDays()+(double)k/24.);
+    rec[9] = ts2;
     dt.AddLine(rec);
   }
@@ -241,5 +257,5 @@
   dtc1.Show();  
   cout << "2.d/  dt.LineHeaderToString() dt.LineToString(k)   : " << endl;
-  cout << dt.LineHeaderToString() ;
+  cout << dt.LineHeaderToString() << endl;
   for(int k = 0; k<1500; k+=75) 
     cout << "Line[" << k << "] " << dt.LineToString(k) << endl ; 
@@ -257,6 +273,27 @@
     cout << dtr;
     cout << "4.c/  dtr.LineHeaderToString() dtr.LineToString(k)   : " << endl;
-    cout << dtr.LineHeaderToString() ;
+    cout << dtr.LineHeaderToString() << endl;
     for(int k = 0; k<1500; k+=75) 
+      cout << "Line[" << k << "] " << dtr.LineToString(k) << endl ; 
+    
+  }
+  {
+    cout << "5/ Reading DataTable dtr from text file dtable.txt " << endl;
+    {
+      cout << "5.a Writing lines to file dtable.txt " << endl; 
+      ofstream os("dtable.txt");
+      dt.Print(os,0,450);
+    }
+    cout << "5.b CopyStructure + FillFromASCIIFile from dtable.txt " << endl; 
+    ifstream is("dtable.txt");
+    DataTable dtr;
+    dtr.CopyStructure(dt);
+    dtr.FillFromASCIIFile(is);
+    cout << dtr;
+    cout << "5.c/  dtr.LineHeaderToString() dtr.LineToString(k)   : " << endl;
+    cout << dtr.LineHeaderToString() << endl;
+    for(int k = 0; k<10; k++) 
+      cout << "Line[" << k << "] " << dtr.LineToString(k) << endl ; 
+    for(int k = 50; k<300; k+=25) 
       cout << "Line[" << k << "] " << dtr.LineToString(k) << endl ; 
     
@@ -273,4 +310,5 @@
     SwPPFDataTable dt(po, 64);
     dt.AddIntegerColumn("line");
+    dt.AddStringColumn("sline");
     dt.AddDoubleColumn("x");
     dt.AddFloatColumn("f_sin");
@@ -280,19 +318,27 @@
     dt.AddComplexColumn("cmplx_cos_sin");
     dt.AddDoubleComplexColumn("dcmplx_cos_sin");
+    dt.AddDateTimeColumn("datime");
     MuTyV rec[10];
+    TimeStamp ts("01/3/2005","0:0:0"); 
+    TimeStamp ts2(0.);
     cout << " 1/ First 1000 lines .... " << endl;
     for(int k = 0; k<1000; k++) {
       rec[0] = k;
+      string sline = "L-";
+      sline += (string)rec[0];
+      rec[1] = sline;
       double x = M_PI*k/100.;
       double fx = sin(x)*cos(x);
       double sx = sin(x);
       double cx = cos(x);
-      rec[1] = x;
-      rec[2] = sx;
-      rec[3] = cx;
-      rec[4] = fx;
-      rec[5] = x*x;
-      rec[6] = complex<r_4>(cx, sx);
-      rec[7] = complex<r_8>(cx, sx);
+      rec[2] = x;
+      rec[3] = sx;
+      rec[4] = cx;
+      rec[5] = fx;
+      rec[6] = x*x;
+      rec[7] = complex<r_4>(cx, sx);
+      rec[8] = complex<r_8>(cx, sx);
+      ts2.Set(ts.ToDays()+(double)k/24.);
+      rec[9] = ts2;
       dt.AddLine(rec);
     }
@@ -304,11 +350,20 @@
     for(int k = 1000; k<2000; k++) {
       rec[0] = k;
+      string sline = "L-";
+      sline += (string)rec[0];
+      rec[1] = sline;
       double x = M_PI*k/100.;
       double fx = sin(x)*cos(x);
-      rec[1] = x;
-      rec[2] = sin(x);
-      rec[3] = cos(x);
-      rec[4] = fx;
-      rec[5] = x*x;
+      double sx = sin(x);
+      double cx = cos(x);
+      rec[2] = x;
+      rec[3] = sx;
+      rec[4] = cx;
+      rec[5] = fx;
+      rec[6] = x*x;
+      rec[7] = complex<r_4>(cx, sx);
+      rec[8] = complex<r_8>(cx, sx);
+      ts2.Set(ts.ToDays()+(double)k/24.);
+      rec[9] = ts2;
       dt.AddLine(rec);
     }
@@ -328,5 +383,5 @@
     cout << dtr;
     cout << "4.c/  dtr.LineHeaderToString() dtr.LineToString(k)   : " << endl;
-    cout << dtr.LineHeaderToString() ;
+    cout << dtr.LineHeaderToString() << endl;
     for(int k = 0; k<1500; k+=75) 
       cout << "Line[" << k << "] " << dtr.LineToString(k) << endl ;     
