Index: trunk/SophyaLib/HiStats/basedtable.cc
===================================================================
--- trunk/SophyaLib/HiStats/basedtable.cc	(revision 2808)
+++ trunk/SophyaLib/HiStats/basedtable.cc	(revision 2827)
@@ -44,6 +44,6 @@
     break;
   case DateField :
-    if (fgl) rs = "Date";
-    else rs = "Date";
+    if (fgl) rs = "DateTime";
+    else rs = "T";
     break;
   default:
@@ -156,4 +156,8 @@
   for(sa_size_t k=0; k<mDColsP.size(); k++) 
     mDColsP[k]->GetSegment(bid)[off] = data[mDColIdx[k]];
+  for(sa_size_t k=0; k<mYColsP.size(); k++) 
+    mYColsP[k]->GetSegment(bid)[off] = complex<r_4>(data[mYColIdx[k]],0.);
+  for(sa_size_t k=0; k<mZColsP.size(); k++) 
+    mZColsP[k]->GetSegment(bid)[off] = complex<r_8>(data[mZColIdx[k]],0.);
   for(sa_size_t k=0; k<mSColsP.size(); k++) 
     mSColsP[k]->GetSegment(bid)[off] = (string)MuTyV(data[mSColIdx[k]]);
@@ -190,4 +194,10 @@
   for(sa_size_t k=0; k<mDColsP.size(); k++) 
     mDColsP[k]->GetSegment(bid)[off] = (r_8)data[mDColIdx[k]];
+  for(sa_size_t k=0; k<mYColsP.size(); k++) 
+    mYColsP[k]->GetSegment(bid)[off] = 
+      complex<r_4>(data[mYColIdx[k]].GetRealPart(), data[mYColIdx[k]].GetImagPart());
+  for(sa_size_t k=0; k<mZColsP.size(); k++) 
+    mZColsP[k]->GetSegment(bid)[off] = 
+      complex<r_8>(data[mZColIdx[k]].GetRealPart(), data[mZColIdx[k]].GetImagPart());
 
   mNEnt++;
@@ -205,4 +215,8 @@
   for(sa_size_t k=0; k<mDColsP.size(); k++)     
     mDColsP[k]->Extend();
+  for(sa_size_t k=0; k<mYColsP.size(); k++) 
+    mYColsP[k]->Extend();
+  for(sa_size_t k=0; k<mZColsP.size(); k++) 
+    mZColsP[k]->Extend();
   for(sa_size_t k=0; k<mSColsP.size(); k++) 
     mSColsP[k]->Extend();
@@ -228,4 +242,8 @@
   for(sa_size_t k=0; k<mDColsP.size(); k++) 
     mVarMTV[mDColIdx[k]] = mDColsP[k]->GetCstSegment(bid)[off];
+  for(sa_size_t k=0; k<mYColsP.size(); k++) 
+    mVarMTV[mYColIdx[k]] = mYColsP[k]->GetCstSegment(bid)[off];
+  for(sa_size_t k=0; k<mZColsP.size(); k++) 
+    mVarMTV[mZColIdx[k]] = mZColsP[k]->GetCstSegment(bid)[off];
   for(sa_size_t k=0; k<mSColsP.size(); k++) 
     mVarMTV[mSColIdx[k]] = atof(mSColsP[k]->GetCstSegment(bid)[off].c_str());
@@ -336,4 +354,8 @@
   for(sa_size_t k=0; k<mDColsP.size(); k++) 
     mVarD[mDColIdx[k]] = mDColsP[k]->GetCstSegment(bid)[off];
+  for(sa_size_t k=0; k<mYColsP.size(); k++) 
+    mVarD[mYColIdx[k]] = mYColsP[k]->GetCstSegment(bid)[off].real();
+  for(sa_size_t k=0; k<mZColsP.size(); k++) 
+    mVarD[mZColIdx[k]] = mZColsP[k]->GetCstSegment(bid)[off].real();
   for(sa_size_t k=0; k<mSColsP.size(); k++) 
     mVarD[mSColIdx[k]] = atof(mSColsP[k]->GetCstSegment(bid)[off].c_str());
@@ -366,5 +388,12 @@
     break;
   case DoubleField :
-    rv = mDColsP[sk]->GetCstSegment(bid)[off];
+  case DateField :
+   rv = mDColsP[sk]->GetCstSegment(bid)[off];
+    break;
+  case ComplexField :
+    rv = mYColsP[sk]->GetCstSegment(bid)[off].real();
+    break;
+  case DoubleComplexField :
+    rv = mZColsP[sk]->GetCstSegment(bid)[off].real();
     break;
   case StringField :
@@ -407,4 +436,10 @@
     rv = mDColsP[sk]->GetCstSegment(bid)[off];
     break;
+  case ComplexField :
+    rv = mYColsP[sk]->GetCstSegment(bid)[off];
+    break;
+  case DoubleComplexField :
+    rv = mZColsP[sk]->GetCstSegment(bid)[off];
+    break;
   case StringField :
     rv = mSColsP[sk]->GetCstSegment(bid)[off];
@@ -482,4 +517,26 @@
 	if (sp[n] > max) max = sp[n];
 	if (sp[n] < min) min = sp[n];
+	cnt++;
+      }
+    }
+    break;
+  case ComplexField :
+    for(size_t is=0; is<mYColsP[sk]->NbSegments(); is++) {
+      const complex<r_4> * sp = mYColsP[sk]->GetCstSegment(is);
+      for(size_t n=0; n<mYColsP[sk]->SegmentSize(); n++) {
+	if (cnt >= NEntry())  break;
+	if (sp[n].real() > max) max = sp[n].real();
+	if (sp[n].real() < min) min = sp[n].real();
+	cnt++;
+      }
+    }
+    break;
+  case DoubleComplexField :
+    for(size_t is=0; is<mZColsP[sk]->NbSegments(); is++) {
+      const complex<r_8> * sp = mZColsP[sk]->GetCstSegment(is);
+      for(size_t n=0; n<mZColsP[sk]->SegmentSize(); n++) {
+	if (cnt >= NEntry())  break;
+	if (sp[n].real() > max) max = sp[n].real();
+	if (sp[n].real() < min) min = sp[n].real();
 	cnt++;
       }
@@ -583,4 +640,10 @@
       rv = mDColsP[sk]->GetCstSegment(bid)[off];
       break;
+    case ComplexField :
+      rv = mYColsP[sk]->GetCstSegment(bid)[off];
+      break;
+    case DoubleComplexField :
+      rv = mZColsP[sk]->GetCstSegment(bid)[off];
+      break;
     case StringField :
       rv = mSColsP[sk]->GetCstSegment(bid)[off];
