Index: /trunk/SophyaExt/FitsIOServer/Makefile
===================================================================
--- /trunk/SophyaExt/FitsIOServer/Makefile	(revision 1659)
+++ /trunk/SophyaExt/FitsIOServer/Makefile	(revision 1660)
@@ -3,7 +3,7 @@
 all: $(LIB)libFitsIOServer.a
 clean:
-	rm -f $(OBJ)fabtcolread.o $(OBJ)fabtwriter.o $(OBJ)fbtntintf.o $(OBJ)fitsautoreader.o $(OBJ)fitsbntbllineRW.o $(OBJ)fitsfile.o $(OBJ)fitslocalmap.o $(OBJ)fitsntuple.o $(OBJ)fitsspherehealpix.o $(OBJ)fitstarray.o $(OBJ)fitsxntuple.o
+	rm -f $(OBJ)fabtcolread.o $(OBJ)fabtwriter.o $(OBJ)fboloread.o $(OBJ)fbtntintf.o $(OBJ)fitsautoreader.o $(OBJ)fitsbntbllineRW.o $(OBJ)fitsfile.o $(OBJ)fitslocalmap.o $(OBJ)fitsntuple.o $(OBJ)fitsspherehealpix.o $(OBJ)fitstarray.o $(OBJ)fitsxntuple.o
 	rm -f $(LIB)libFitsIOServer.a
-$(LIB)libFitsIOServer.a : $(OBJ)fabtcolread.o $(OBJ)fabtwriter.o $(OBJ)fbtntintf.o $(OBJ)fitsautoreader.o $(OBJ)fitsbntbllineRW.o $(OBJ)fitsfile.o $(OBJ)fitslocalmap.o $(OBJ)fitsntuple.o $(OBJ)fitsspherehealpix.o $(OBJ)fitstarray.o $(OBJ)fitsxntuple.o
+$(LIB)libFitsIOServer.a : $(OBJ)fabtcolread.o $(OBJ)fabtwriter.o $(OBJ)fboloread.o $(OBJ)fbtntintf.o $(OBJ)fitsautoreader.o $(OBJ)fitsbntbllineRW.o $(OBJ)fitsfile.o $(OBJ)fitslocalmap.o $(OBJ)fitsntuple.o $(OBJ)fitsspherehealpix.o $(OBJ)fitstarray.o $(OBJ)fitsxntuple.o
 	$(ARCXX) $(ARCXXFLAGS) $@ $?
 ifeq ($(CXX),cxx)
@@ -11,215 +11,222 @@
 endif 
  
-$(OBJ)fabtcolread.o: fabtcolread.cc \
- $(INC)machdefs.h \
- $(INC)pexceptions.h \
- fabtcolread.h $(INC)anydataobj.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)mutyv.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)ppersist.h \
- $(INC)gnumd5.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h \
- $(EXTINCPATH)FitsIO/fitsio.h \
- $(EXTINCPATH)FitsIO/longnam.h
-$(OBJ)fabtwriter.o: fabtwriter.cc \
- $(INC)machdefs.h \
- $(INC)pexceptions.h fabtwriter.h \
- $(INC)anydataobj.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)mutyv.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)ppersist.h \
- $(INC)gnumd5.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h \
- $(EXTINCPATH)FitsIO/fitsio.h \
- $(EXTINCPATH)FitsIO/longnam.h
-$(OBJ)fbtntintf.o: fbtntintf.cc \
- $(INC)machdefs.h \
- $(INC)pexceptions.h fbtntintf.h \
- $(INC)anydataobj.h \
- $(INC)ntupintf.h \
- $(EXTINCPATH)FitsIO/fitsio.h \
- $(EXTINCPATH)FitsIO/longnam.h
+$(OBJ)fabtcolread.o: fabtcolread.cc $(INC)machdefs.h \
+  $(INC)pexceptions.h fabtcolread.h \
+  $(INC)anydataobj.h \
+  $(INC)tvector.h \
+  $(INC)tmatrix.h \
+  $(INC)tarray.h \
+  $(INC)basarr.h \
+  $(INC)mutyv.h \
+  $(INC)dvlist.h \
+  $(INC)objfio.h \
+  $(INC)ppersist.h \
+  $(INC)gnumd5.h \
+  $(INC)ndatablock.h \
+  $(INC)utilarr.h \
+  $(EXTINCPATH)FitsIO/fitsio.h \
+  $(EXTINCPATH)FitsIO/longnam.h
+$(OBJ)fabtwriter.o: fabtwriter.cc $(INC)machdefs.h \
+  $(INC)pexceptions.h fabtwriter.h \
+  $(INC)anydataobj.h \
+  $(INC)tvector.h \
+  $(INC)tmatrix.h \
+  $(INC)tarray.h \
+  $(INC)basarr.h \
+  $(INC)mutyv.h \
+  $(INC)dvlist.h \
+  $(INC)objfio.h \
+  $(INC)ppersist.h \
+  $(INC)gnumd5.h \
+  $(INC)ndatablock.h \
+  $(INC)utilarr.h \
+  $(EXTINCPATH)FitsIO/fitsio.h \
+  $(EXTINCPATH)FitsIO/longnam.h
+$(OBJ)fboloread.o: fboloread.cc $(INC)machdefs.h \
+  $(INC)pexceptions.h fboloread.h \
+  $(INC)anydataobj.h \
+  $(INC)tvector.h \
+  $(INC)tmatrix.h \
+  $(INC)tarray.h \
+  $(INC)basarr.h \
+  $(INC)mutyv.h \
+  $(INC)dvlist.h \
+  $(INC)objfio.h \
+  $(INC)ppersist.h \
+  $(INC)gnumd5.h \
+  $(INC)ndatablock.h \
+  $(INC)utilarr.h fabtcolread.h \
+  $(EXTINCPATH)FitsIO/fitsio.h \
+  $(EXTINCPATH)FitsIO/longnam.h
+$(OBJ)fbtntintf.o: fbtntintf.cc $(INC)machdefs.h \
+  $(INC)pexceptions.h fbtntintf.h \
+  $(INC)anydataobj.h \
+  $(INC)ntupintf.h \
+  $(EXTINCPATH)FitsIO/fitsio.h \
+  $(EXTINCPATH)FitsIO/longnam.h
 $(OBJ)fitsautoreader.o: fitsautoreader.cc \
- $(INC)pexceptions.h \
- $(INC)machdefs.h \
- fitsautoreader.h \
- $(INC)anydataobj.h fitsfile.h \
- $(INC)ndatablock.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)ppersist.h \
- $(INC)gnumd5.h \
- $(INC)mutyv.h \
- $(EXTINCPATH)FitsIO/fitsio.h \
- $(EXTINCPATH)FitsIO/longnam.h fitstarray.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)utilarr.h \
- fitsspherehealpix.h \
- $(INC)spherehealpix.h \
- $(INC)sphericalmap.h \
- $(INC)smathconst.h \
- $(INC)pixelmap.h \
- $(INC)spherepos.h \
- $(INC)unitvector.h \
- $(INC)vector3d.h \
- $(INC)longlat.h \
- $(INC)utilgeom.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)HEALPixUtils.h \
- fitsntuple.h $(INC)ntuple.h \
- $(INC)ntupintf.h fitsxntuple.h \
- $(INC)xntuple.h fitslocalmap.h \
- $(INC)localmap.h
+  $(INC)pexceptions.h \
+  $(INC)machdefs.h fitsautoreader.h \
+  $(INC)anydataobj.h fitsfile.h \
+  $(INC)ndatablock.h \
+  $(INC)dvlist.h \
+  $(INC)objfio.h \
+  $(INC)ppersist.h \
+  $(INC)gnumd5.h \
+  $(INC)mutyv.h \
+  $(EXTINCPATH)FitsIO/fitsio.h \
+  $(EXTINCPATH)FitsIO/longnam.h fitstarray.h \
+  $(INC)tarray.h \
+  $(INC)basarr.h \
+  $(INC)utilarr.h fitsspherehealpix.h \
+  $(INC)spherehealpix.h \
+  $(INC)sphericalmap.h \
+  $(INC)smathconst.h \
+  $(INC)pixelmap.h \
+  $(INC)spherepos.h \
+  $(INC)unitvector.h \
+  $(INC)vector3d.h \
+  $(INC)longlat.h \
+  $(INC)utilgeom.h \
+  $(INC)tvector.h \
+  $(INC)tmatrix.h \
+  $(INC)HEALPixUtils.h fitsntuple.h \
+  $(INC)ntuple.h \
+  $(INC)ntupintf.h fitsxntuple.h \
+  $(INC)xntuple.h fitslocalmap.h \
+  $(INC)localmap.h
 $(OBJ)fitsbntbllineRW.o: fitsbntbllineRW.cc \
- $(INC)pexceptions.h \
- $(INC)machdefs.h \
- fitsbntbllineRW.h $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)anydataobj.h \
- $(INC)ppersist.h \
- $(INC)gnumd5.h \
- $(INC)mutyv.h fitsfile.h \
- $(INC)ndatablock.h \
- $(EXTINCPATH)FitsIO/fitsio.h \
- $(EXTINCPATH)FitsIO/longnam.h \
- $(INC)utils.h
-$(OBJ)fitsfile.o: fitsfile.cc \
- $(INC)machdefs.h fitsfile.h \
- $(INC)ndatablock.h \
- $(INC)anydataobj.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)ppersist.h \
- $(INC)pexceptions.h \
- $(INC)gnumd5.h \
- $(INC)mutyv.h \
- $(EXTINCPATH)FitsIO/fitsio.h \
- $(EXTINCPATH)FitsIO/longnam.h \
- $(INC)strutil.h \
- fitsspherehealpix.h \
- $(INC)spherehealpix.h \
- $(INC)sphericalmap.h \
- $(INC)smathconst.h \
- $(INC)pixelmap.h \
- $(INC)spherepos.h \
- $(INC)unitvector.h \
- $(INC)vector3d.h \
- $(INC)longlat.h \
- $(INC)utilgeom.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)utilarr.h \
- $(INC)HEALPixUtils.h
+  $(INC)pexceptions.h \
+  $(INC)machdefs.h fitsbntbllineRW.h \
+  $(INC)dvlist.h \
+  $(INC)objfio.h \
+  $(INC)anydataobj.h \
+  $(INC)ppersist.h \
+  $(INC)gnumd5.h \
+  $(INC)mutyv.h fitsfile.h \
+  $(INC)ndatablock.h \
+  $(EXTINCPATH)FitsIO/fitsio.h \
+  $(EXTINCPATH)FitsIO/longnam.h \
+  $(INC)utils.h
+$(OBJ)fitsfile.o: fitsfile.cc $(INC)machdefs.h \
+  fitsfile.h $(INC)ndatablock.h \
+  $(INC)anydataobj.h \
+  $(INC)dvlist.h \
+  $(INC)objfio.h \
+  $(INC)ppersist.h \
+  $(INC)pexceptions.h \
+  $(INC)gnumd5.h \
+  $(INC)mutyv.h \
+  $(EXTINCPATH)FitsIO/fitsio.h \
+  $(EXTINCPATH)FitsIO/longnam.h \
+  $(INC)strutil.h fitsspherehealpix.h \
+  $(INC)spherehealpix.h \
+  $(INC)sphericalmap.h \
+  $(INC)smathconst.h \
+  $(INC)pixelmap.h \
+  $(INC)spherepos.h \
+  $(INC)unitvector.h \
+  $(INC)vector3d.h \
+  $(INC)longlat.h \
+  $(INC)utilgeom.h \
+  $(INC)tvector.h \
+  $(INC)tmatrix.h \
+  $(INC)tarray.h \
+  $(INC)basarr.h \
+  $(INC)utilarr.h \
+  $(INC)HEALPixUtils.h
 $(OBJ)fitslocalmap.o: fitslocalmap.cc \
- $(INC)machdefs.h fitslocalmap.h \
- $(INC)pexceptions.h \
- $(INC)localmap.h \
- $(INC)pixelmap.h \
- $(INC)ppersist.h \
- $(INC)gnumd5.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)anydataobj.h \
- $(INC)mutyv.h \
- $(INC)spherepos.h \
- $(INC)unitvector.h \
- $(INC)vector3d.h \
- $(INC)longlat.h \
- $(INC)utilgeom.h \
- $(INC)sphericalmap.h \
- $(INC)smathconst.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h fitsfile.h \
- $(EXTINCPATH)FitsIO/fitsio.h \
- $(EXTINCPATH)FitsIO/longnam.h
+  $(INC)machdefs.h fitslocalmap.h \
+  $(INC)pexceptions.h \
+  $(INC)localmap.h \
+  $(INC)pixelmap.h \
+  $(INC)ppersist.h \
+  $(INC)gnumd5.h \
+  $(INC)dvlist.h \
+  $(INC)objfio.h \
+  $(INC)anydataobj.h \
+  $(INC)mutyv.h \
+  $(INC)spherepos.h \
+  $(INC)unitvector.h \
+  $(INC)vector3d.h \
+  $(INC)longlat.h \
+  $(INC)utilgeom.h \
+  $(INC)sphericalmap.h \
+  $(INC)smathconst.h \
+  $(INC)tvector.h \
+  $(INC)tmatrix.h \
+  $(INC)tarray.h \
+  $(INC)basarr.h \
+  $(INC)ndatablock.h \
+  $(INC)utilarr.h fitsfile.h \
+  $(EXTINCPATH)FitsIO/fitsio.h \
+  $(EXTINCPATH)FitsIO/longnam.h
 $(OBJ)fitsntuple.o: fitsntuple.cc \
- $(INC)pexceptions.h \
- $(INC)machdefs.h fitsntuple.h \
- $(INC)ntuple.h \
- $(INC)objfio.h \
- $(INC)anydataobj.h \
- $(INC)ppersist.h \
- $(INC)gnumd5.h \
- $(INC)ntupintf.h \
- $(INC)dvlist.h \
- $(INC)mutyv.h fitsfile.h \
- $(INC)ndatablock.h \
- $(EXTINCPATH)FitsIO/fitsio.h \
- $(EXTINCPATH)FitsIO/longnam.h
+  $(INC)pexceptions.h \
+  $(INC)machdefs.h fitsntuple.h \
+  $(INC)ntuple.h \
+  $(INC)objfio.h \
+  $(INC)anydataobj.h \
+  $(INC)ppersist.h \
+  $(INC)gnumd5.h \
+  $(INC)ntupintf.h \
+  $(INC)dvlist.h \
+  $(INC)mutyv.h fitsfile.h \
+  $(INC)ndatablock.h \
+  $(EXTINCPATH)FitsIO/fitsio.h \
+  $(EXTINCPATH)FitsIO/longnam.h
 $(OBJ)fitsspherehealpix.o: fitsspherehealpix.cc \
- $(INC)pexceptions.h \
- $(INC)machdefs.h \
- fitsspherehealpix.h \
- $(INC)spherehealpix.h \
- $(INC)sphericalmap.h \
- $(INC)smathconst.h \
- $(INC)pixelmap.h \
- $(INC)ppersist.h \
- $(INC)gnumd5.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)anydataobj.h \
- $(INC)mutyv.h \
- $(INC)spherepos.h \
- $(INC)unitvector.h \
- $(INC)vector3d.h \
- $(INC)longlat.h \
- $(INC)utilgeom.h \
- $(INC)tvector.h \
- $(INC)tmatrix.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h \
- $(INC)HEALPixUtils.h fitsfile.h \
- $(EXTINCPATH)FitsIO/fitsio.h \
- $(EXTINCPATH)FitsIO/longnam.h fitstarray.h
-$(OBJ)fitstarray.o: fitstarray.cc \
- $(INC)machdefs.h \
- $(INC)pexceptions.h fitstarray.h \
- $(INC)tarray.h \
- $(INC)basarr.h \
- $(INC)anydataobj.h \
- $(INC)mutyv.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)ppersist.h \
- $(INC)gnumd5.h \
- $(INC)ndatablock.h \
- $(INC)utilarr.h fitsfile.h \
- $(EXTINCPATH)FitsIO/fitsio.h \
- $(EXTINCPATH)FitsIO/longnam.h
+  $(INC)pexceptions.h \
+  $(INC)machdefs.h fitsspherehealpix.h \
+  $(INC)spherehealpix.h \
+  $(INC)sphericalmap.h \
+  $(INC)smathconst.h \
+  $(INC)pixelmap.h \
+  $(INC)ppersist.h \
+  $(INC)gnumd5.h \
+  $(INC)dvlist.h \
+  $(INC)objfio.h \
+  $(INC)anydataobj.h \
+  $(INC)mutyv.h \
+  $(INC)spherepos.h \
+  $(INC)unitvector.h \
+  $(INC)vector3d.h \
+  $(INC)longlat.h \
+  $(INC)utilgeom.h \
+  $(INC)tvector.h \
+  $(INC)tmatrix.h \
+  $(INC)tarray.h \
+  $(INC)basarr.h \
+  $(INC)ndatablock.h \
+  $(INC)utilarr.h \
+  $(INC)HEALPixUtils.h fitsfile.h \
+  $(EXTINCPATH)FitsIO/fitsio.h \
+  $(EXTINCPATH)FitsIO/longnam.h fitstarray.h
+$(OBJ)fitstarray.o: fitstarray.cc $(INC)machdefs.h \
+  $(INC)pexceptions.h fitstarray.h \
+  $(INC)tarray.h \
+  $(INC)basarr.h \
+  $(INC)anydataobj.h \
+  $(INC)mutyv.h \
+  $(INC)dvlist.h \
+  $(INC)objfio.h \
+  $(INC)ppersist.h \
+  $(INC)gnumd5.h \
+  $(INC)ndatablock.h \
+  $(INC)utilarr.h fitsfile.h \
+  $(EXTINCPATH)FitsIO/fitsio.h \
+  $(EXTINCPATH)FitsIO/longnam.h
 $(OBJ)fitsxntuple.o: fitsxntuple.cc \
- $(INC)pexceptions.h \
- $(INC)machdefs.h fitsxntuple.h \
- $(INC)xntuple.h \
- $(INC)ntupintf.h \
- $(INC)ppersist.h \
- $(INC)gnumd5.h \
- $(INC)dvlist.h \
- $(INC)objfio.h \
- $(INC)anydataobj.h \
- $(INC)mutyv.h fitsfile.h \
- $(INC)ndatablock.h \
- $(EXTINCPATH)FitsIO/fitsio.h \
- $(EXTINCPATH)FitsIO/longnam.h
+  $(INC)pexceptions.h \
+  $(INC)machdefs.h fitsxntuple.h \
+  $(INC)xntuple.h \
+  $(INC)ntupintf.h \
+  $(INC)ppersist.h \
+  $(INC)gnumd5.h \
+  $(INC)dvlist.h \
+  $(INC)objfio.h \
+  $(INC)anydataobj.h \
+  $(INC)mutyv.h fitsfile.h \
+  $(INC)ndatablock.h \
+  $(EXTINCPATH)FitsIO/fitsio.h \
+  $(EXTINCPATH)FitsIO/longnam.h
Index: /trunk/SophyaExt/FitsIOServer/fabtcolread.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fabtcolread.cc	(revision 1659)
+++ /trunk/SophyaExt/FitsIOServer/fabtcolread.cc	(revision 1660)
@@ -187,5 +187,5 @@
 
  // Get column number
- char labelcol[256];
+ char labelcol[128];
  if(ColLabel.size() > 0) {
    strcpy(labelcol,ColLabel.c_str());
@@ -209,5 +209,6 @@
  }
  if(DbgLevel>1) cout<<"...Init ColTypeCode="<<ColTypeCode<<endl;
- if(ColTypeCode==TSTRING || ColTypeCode==TCOMPLEX ||  ColTypeCode==TDBLCOMPLEX) {
+ if(ColTypeCode==TSTRING || ColTypeCode==TCOMPLEX ||  ColTypeCode==TDBLCOMPLEX
+                         || ColTypeCode<0 ) {
    Delete();
    throw ParmError("FitsABTColRead::Init: Selected column is not Numerical\n");
Index: /trunk/SophyaExt/FitsIOServer/fabtwriter.cc
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fabtwriter.cc	(revision 1659)
+++ /trunk/SophyaExt/FitsIOServer/fabtwriter.cc	(revision 1660)
@@ -15,9 +15,9 @@
   FitsABTWriter fbtw(fitswrit,BINARY_TBL);
   fbtw.SetExtName("MY_OWN_EXTENSION");
-  fbtw.AddCol("vars",TSHORT,"","km");       // col=0
-  fbtw.AddCol("vars2",TSHORT,"","km");      // col=1
-  fbtw.AddCol("varl",TINT32BIT,"","Degre"); // col=2
-  fbtw.AddCol("varf",TFLOAT,"","");         // col=3
-  fbtw.AddCol("vard",TDOUBLE,"","arcmin");  // col=4
+  fbtw.AddCol("vars",NULL,"km",TSHORT);       // col=0
+  fbtw.AddCol("vars2",NULL,"km",TSHORT);      // col=1
+  fbtw.AddCol("varl",NULL,"Degre",TINT32BIT); // col=2
+  fbtw.AddCol("varf",NULL,"",TFLOAT);         // col=3
+  fbtw.AddCol("vard","","arcmin",TDOUBLE);    // col=4
   fbtw.SetDebug(3);
   for(long i=0;i<1000;i++) {
@@ -119,33 +119,45 @@
   Add a new column to the FITS table
   \param label : column label
-  \param datatype : TSHORT TINT32BIT TFLOAT or TDOUBLE
-  \param tform : fits tform definition
-         (can be automatically set if BINARY_TBL and tform="")
+  \param tform : fits tform definition ("1I","1J","1E","1J",...)
+         (can be automatically set as "datatype"
+          if BINARY_TBL and tform="" or tform=NULL)
   \param tunit : fits tunit definition (optional)
+  \param datatype : TBYTE TSHORT TINT32BIT TLONG TFLOAT TDOUBLE
+                    TUSHORT TULONG. That parameter is only use in case
+                    of a BINARY_TBL table when tform is not defined).
   \return The number of the new added column in the table.
   \warning col = [0,ncol-1]
 */
-int FitsABTWriter::addcol(const char* label,int datatype
-                         ,const char* tform,const char* tunit)
+int FitsABTWriter::addcol(const char* label,const char* tform
+                         ,const char* tunit,int datatype)
 {
   if(!FirstTime)
     throw AllocationError("FitsABTWriter::addcol: table already created\n");
-
- if(  datatype!=TSHORT && datatype!=TINT32BIT
-   && datatype!=TFLOAT && datatype!=TDOUBLE )
-   throw ParmError("FitsABTWriter::addcol: datatype not allowed\n");
  
- Label.push_back(label);
- DataType.push_back(datatype);
- // Gestion auto du tform par defaut pour les tables binaires
- if(HduType==BINARY_TBL && strlen(tform)<=0) {
-   char str[16];
-   if(datatype==TSHORT)         strcpy(str,"1I");
+ // Gestion auto du tform pour les tables binaires avec le datatype (si non-definie)
+ bool tformauto = false;
+ if(HduType==BINARY_TBL) {
+   if(tform==NULL)      tformauto = true;
+   if(strlen(tform)<=0) tformauto = true;
+ }
+ if(tformauto) {
+   char str[8];
+   if(datatype==TBYTE)          strcpy(str,"1B");
+   else if(datatype==TSHORT)    strcpy(str,"1I");
    else if(datatype==TINT32BIT) strcpy(str,"1J");
+   else if(datatype==TLONG)     strcpy(str,"1J");
    else if(datatype==TFLOAT)    strcpy(str,"1E");
    else if(datatype==TDOUBLE)   strcpy(str,"1D");
+   else if(datatype==TUSHORT)   strcpy(str,"1U");
+   else if(datatype==TULONG)    strcpy(str,"1V");
+   else
+     throw ParmError("FitsABTWriter::addcol: datatype not allowed\n");
    TForm.push_back(str);
- } else TForm.push_back(tform);
- TUnit.push_back(tunit);
+ } else {
+   if(tform) TForm.push_back(tform); else TForm.push_back("");
+   datatype = 0;
+ }
+ Label.push_back(label);
+ if(tunit) TUnit.push_back(tunit); else TUnit.push_back("");
 
  int n = (int) Label.size() -1;
@@ -153,7 +165,7 @@
  if(DbgLevel)
    cout<<"FitsABTWriter::addcol["<<n<<"] Label="<<Label[n]
-       <<" datatype="<<datatype
        <<" TForm="<<TForm[n]
-       <<" TUnit="<<TUnit[n]<<endl;
+       <<" TUnit="<<TUnit[n]
+       <<" datatype="<<datatype<<endl;
 
  return n;
@@ -220,10 +232,10 @@
   \verbatim
   WARNING: suppose that the column has be defined to be TSHORT
-           and suppose that you wanted to write a double value
-   - If you write dummy.Write(col,row,(short(val))
-       you call the Write(int,long,short) routine and
+           and suppose that you wanted to write a double value "val"
+   - If you write dummy.Write(col,row,(short)(val))
+       the Write(int,long,short) routine is called and
        the cast is performed by the C++ language.
    - If you write dummy.Write(col,row,val) where val is double
-       you call theWrite(int,long,double) routine and
+       the Write(int,long,double) routine is called and
        the cast is performed by the cfistio package.
   \endverbatim
@@ -311,5 +323,5 @@
 
 //////////////////////////////////////////////////////////////
-void FitsABTWriter::printerrorwrite(char* type,int col,long row,int sta)
+void FitsABTWriter::printerrorwrite(const char* type,int col,long row,int sta)
 {
  if(sta==NUM_OVERFLOW) {NOverFlow++; return;}
Index: /trunk/SophyaExt/FitsIOServer/fabtwriter.h
===================================================================
--- /trunk/SophyaExt/FitsIOServer/fabtwriter.h	(revision 1659)
+++ /trunk/SophyaExt/FitsIOServer/fabtwriter.h	(revision 1660)
@@ -24,11 +24,11 @@
 
   //! Add a new column to the FITS table and return its number (see addcol).
-  inline int AddCol(string label,int datatype=TDOUBLE
-                   ,string tform=string(""),string tunit=string(""))
-     {return addcol(label.c_str(),datatype,tform.c_str(),tunit.c_str());}
+  inline int AddCol(string label,string tform=string("")
+                   ,string tunit=string(""),int datatype=TDOUBLE)
+     {return addcol(label.c_str(),tform.c_str(),tunit.c_str(),datatype);}
   //! Add a new column to the FITS table and return its number (see addcol).
-  inline int AddCol(const char* label,int datatype=TDOUBLE
-                   ,const char* tform="",const char* tunit="")
-     {return addcol(label,datatype,tform,tunit);}
+  inline int AddCol(const char* label,const char* tform=""
+                   ,const char* tunit="",int datatype=TDOUBLE)
+     {return addcol(label,tform,tunit,datatype);}
 
   //! Set the FITS table extension name
@@ -51,8 +51,8 @@
 protected:
   void createfits(const char *cfname,int hdutype,int lp);
-  int addcol(const char* label,int datatype
-            ,const char* tform,const char* tunit);
+  int addcol(const char* label,const char* tform
+            ,const char* tunit,int datatype);
   void createtbl(void);
-  void printerrorwrite(char* type,int col,long row,int sta);
+  void printerrorwrite(const char* type,int col,long row,int sta);
   void printerror(int sta) const;
 
@@ -63,5 +63,4 @@
   bool FirstTime;
   vector<string> Label;
-  vector<int> DataType;
   vector<string> TForm;
   vector<string> TUnit;
Index: /trunk/SophyaExt/FitsIOServer/objlist.list
===================================================================
--- /trunk/SophyaExt/FitsIOServer/objlist.list	(revision 1659)
+++ /trunk/SophyaExt/FitsIOServer/objlist.list	(revision 1660)
@@ -1,4 +1,5 @@
 fabtcolread.o
 fabtwriter.o
+fboloread.o
 fbtntintf.o
 fitsautoreader.o
