Index: trunk/SophyaPI/PIext/basexecut.cc
===================================================================
--- trunk/SophyaPI/PIext/basexecut.cc	(revision 2402)
+++ trunk/SophyaPI/PIext/basexecut.cc	(revision 2419)
@@ -581,10 +581,10 @@
     return(0);
   }
-  int kks = 0;
-  int kke = v->NElts();
-  int kkp = 1;
+  int_8 kks = 0;
+  int_8 kke = v->NElts();
+  int_8 kkp = 1;
   if (tokens.size() > 2) Services2NObjMgr::DecodeLoopParameters(tokens[2], kks, kke, kkp);
   if (kks < 0)  kks = 0;
-  if (kke > v->NElts()) kke = v->NElts();
+  if (kke > (int_8)v->NElts()) kke = v->NElts();
   if (kkp < 1) kkp = 1;
   int nelt = (kke-kks-1)/kkp;
@@ -646,10 +646,10 @@
       return(0);
     }
-    int kks = 0;
-    int kke = nti->NbLines();
-    int kkp = 1;
+    int_8 kks = 0;
+    int_8 kke = nti->NbLines();
+    int_8 kkp = 1;
     if (tokens.size() > 3) Services2NObjMgr::DecodeLoopParameters(tokens[3], kks, kke, kkp);
     if (kks < 0)  kks = 0;
-    if (kke > nti->NbLines()) kke = nti->NbLines();
+    if (kke > (int_8)nti->NbLines()) kke = nti->NbLines();
     if (kkp < 1) kkp = 1;
     int nelt = (kke-kks-1)/kkp;
@@ -1070,5 +1070,5 @@
 void PIABaseExecutor::RegisterCommands()
 {
-string kw, usage;
+string kw, usage, grp;
 kw = "loadmodule";
 usage = "To load and initialize modules \n  Usage: loadmodule fnameso modulename";
@@ -1614,18 +1614,19 @@
 usage = "Any mathematical expression (math.h) with object variables can be used";
 usage += "\n  ------ Object Variable names (double) -------- ";
-usage += "\n- NTuple: ntuple variable names";
-usage += "\n- Histo1D/HProf: i,x,val,err";
-usage += "\n- Histo2D: i,j,x,y,val,err";
-usage += "\n- Vector/Matrix: n,r,c,val,real,imag,mod,phas";
-usage += "\n- TArray: n,x,y,z,t,u,val,real,imag,mod,phas";
-usage += "\n- Image: i,j,x,y,val(=pix)";
-usage += "\n- GeneralFitData: x0,ex0 x1,ex1 ...  xn,exn   y,ey   ok";
+usage += "\n  (_nl is the table line number or the sequential index)";
+usage += "\n- NTuple: ntuple variable names,_nl";
+usage += "\n- Histo1D/HProf: i,x,val,err,_nl";
+usage += "\n- Histo2D: i,j,x,y,val,err,_nl";
+usage += "\n- Vector/Matrix: n,r,c,val,real,imag,mod,phas,_nl";
+usage += "\n- TArray: n,x,y,z,t,u,val,real,imag,mod,phas,_nl";
+usage += "\n- Image: i,j,x,y,val(=pix),_nl";
+usage += "\n- GeneralFitData: x0,ex0 x1,ex1 ...  xn,exn   y,ey   ok  ,_nl";
 usage += "\n- LocalMap/SphereThetaPhi/SphereHEALPix: ";
-usage += "\n-         i,k,val,real,imag,mod,phas,teta,phi";
-usage += "\n- FITS Binary/ASCII table: fits column names";
+usage += "\n-         i,k,val,real,imag,mod,phas,teta,phi,_nl";
+usage += "\n- FITS Binary/ASCII table: fits column names,_nl";
 #ifdef SANS_EVOLPLANCK
 usage += "\n  ------ Eros Variable names (double) -------- ";
 usage += "\n- StarList: x,y,flux,fond,pixmax,flags,";
-usage += "\n-           xref,yref,fluxref,fondref,pixmaxref";
+usage += "\n-           xref,yref,fluxref,fondref,pixmaxref,_nl";
 #endif
 usage += "\n  ------ Other parameters -------- ";
@@ -1635,5 +1636,6 @@
 usage += "\n        projh1d projh2d  projprof fillvec fillmtx "; 
 usage += "\n        fillnt fillgd1 fillgd2 ntloop exptovec ... ";
-mpiac->RegisterCommand(kw, usage, NULL, "Expr. Plotting");
+grp = "Expr. Plotting";
+mpiac->RegisterHelp(kw, usage, grp);
 kw = "plot2d";
 usage = "Plots (2D) Y=g(Object) vs. X=f(Object) --- Object Variable names (double) :";
Index: trunk/SophyaPI/PIext/dlftypes.h
===================================================================
--- trunk/SophyaPI/PIext/dlftypes.h	(revision 2402)
+++ trunk/SophyaPI/PIext/dlftypes.h	(revision 2419)
@@ -15,7 +15,9 @@
 typedef double (* DlFunctionOfXY) (double x, double y);
 // ---- Fonctions pour trace d'expressions d'objets ------------
-typedef int (* PlotExprFunc) (double* x, double* rx, double* ry, double* rz, double* rt);
-typedef int (* NTLoopExprFunc) (double* x, double* rx, double* ry, double* rz, 
-                                double* rt, int n, int nmax);
+typedef long long int_8_exprf;
+// ^- Doit etre le meme que dans (Services2NObjMgr::)LinkExprFunc,PrepareNTExpressionCFile
+typedef int (* PlotExprFunc) (int_8_exprf nl, double* x, double* rx, double* ry, double* rz, double* rt);
+typedef int (* NTLoopExprFunc) (int_8_exprf nl, double* x, double* rx, double* ry, double* rz, 
+                                double* rt, int_8_exprf nstart, int_8_exprf nend);
 
 // ---------- Fonctions UserFit ----------------
Index: trunk/SophyaPI/PIext/pawexecut.cc
===================================================================
--- trunk/SophyaPI/PIext/pawexecut.cc	(revision 2402)
+++ trunk/SophyaPI/PIext/pawexecut.cc	(revision 2419)
@@ -501,9 +501,9 @@
 
 // evenements a utiliser
-int_4 k1=0, k2=objnt->NbLines(), dk=1;
+int_8 k1=0, k2=objnt->NbLines(), dk=1;
 srvo.DecodeLoopParameters(loop,k1,k2,dk);
 if (k1<0) k1=0;
 if (k2<0) k2=objnt->NbLines();
-if (k2>(int)objnt->NbLines()) k2=objnt->NbLines();
+if (k2>(int_8)objnt->NbLines()) k2=objnt->NbLines();
 if (dk<=0) dk=1;
 
@@ -522,7 +522,7 @@
   double xnt[5]={0,0,0,0,0};
   double* xn;
-  for(int_4 k=k1; k<k2; k += dk)    {
+  for(int_8 k=k1; k<k2; k += dk)    {
     xn = objnt->GetLineD(k);
-    if(f(xn,xnt,xnt+1,xnt+2,xnt+3) != 0) {
+    if(f((int_8_exprf)k,xn,xnt,xnt+1,xnt+2,xnt+3) != 0) {
       if(fout) fprintf(fout,"%d ",k); else printf("%d ",k);
       for(i=0;i<(int)varnum.size();i++) {
Index: trunk/SophyaPI/PIext/piacmd.cc
===================================================================
--- trunk/SophyaPI/PIext/piacmd.cc	(revision 2402)
+++ trunk/SophyaPI/PIext/piacmd.cc	(revision 2419)
@@ -493,5 +493,5 @@
 usage += "   by Auto_Ini_Ranf(int lp) \n";
 usage += "   Usage: autoiniranf";
-RegisterHelp(kw, usage, grp);
+RegisterCommand(kw, usage, NULL, grp);
 
 kw = "shell execute";
@@ -503,9 +503,9 @@
 usage += "  > shell myfile.csh [arg1] [arg2] [...]\n";
 usage += "    (where the first line of \"myfile.csh\" is \"#!/bin/csh\")\n";
-RegisterHelp(kw, usage, grp);
+RegisterCommand(kw, usage, NULL, grp);
 
 kw = "exitpiapp";
 usage = "To end the piapp session (Interpreter's command)";
-RegisterHelp(kw, usage, grp);
+RegisterCommand(kw, usage, NULL, grp);
 
 basexec = new PIABaseExecutor(this, omg, app);
Index: trunk/SophyaPI/PIext/servnobjm.cc
===================================================================
--- trunk/SophyaPI/PIext/servnobjm.cc	(revision 2402)
+++ trunk/SophyaPI/PIext/servnobjm.cc	(revision 2419)
@@ -909,20 +909,20 @@
 mImgapp->RedirectStdOutErr(false);
 
-int k1,k2,dk;
+int_8 k1,k2,dk;
 k1 = 0;  k2 = objnt->NbLines();  dk = 1;
 DecodeLoopParameters(loop, k1, k2, dk);
 if (k1 < 0) k1 = 0;
 if (k2 < 0) k2 = objnt->NbLines();
-if (k2 > (int_4)objnt->NbLines()) k2 = objnt->NbLines();
+if (k2 > (int_8)objnt->NbLines()) k2 = objnt->NbLines();
 if (dk <= 0) dk = 1;
 
 try  {
   double* xn;
-  int kmax = k2;
-  for(k=k1; k<kmax; k+=dk)    {
+  int_8 kstart = k1, kend = k2;
+  for(k=kstart; k<kend; k+=dk)    {
     xn = objnt->GetLineD(k);
-    if (f(xn, xnt, xnt+1, xnt+2, xnt+3, k, kmax) != 0) {
+    if (f((int_8_exprf)k, xn, xnt, xnt+1, xnt+2, xnt+3, (int_8_exprf)kstart,(int_8_exprf) kend) != 0) {
       if (nt) { 
-         for(i=0; i<4; i++) fxnt[i] = xnt[i]; 
+         for(int i=0; i<4; i++) fxnt[i] = xnt[i]; 
          nt->Fill(fxnt);
          }
@@ -989,7 +989,7 @@
 
 fputs("/* ------ Compare bits on double --------- */ \n", fip);
-fputs("typedef long long int_8;\n", fip);
-fputs("int_8 BitCmp64(double v,int_8 flg)\n", fip);
-fputs("{return ((int_8)((v<0.) ? v-0.1 : v+0.1))&flg;}\n", fip);
+fputs("typedef long long int_8_exprf;\n", fip);
+fputs("int_8_exprf BitCmp64(double v,int_8_exprf flg)\n", fip);
+fputs("{return ((int_8_exprf)((v<0.) ? v-0.1 : v+0.1))&flg;}\n", fip);
 fputs("/* ------ Some random number generators --------- */ \n", fip);
 fputs("#if defined(__ppc__) && defined(__MACH__) \n",fip);
@@ -1011,9 +1011,10 @@
 fputs("#define gaurand() NorRand() \n\n", fip);
 
-fputs("/* NTupleInterface Variable declaration - Generated by piapp  \n", fip);
-fputs("      -- Services2NObjMgr::PrepareNTExpressionCFile()  --     */ \n\n", fip);
-fprintf(fip,"int %s(double* _xnti_, double* _rx_, double* _ry_, double* _rz_, \n", 
+fputs("/* NTupleInterface Variable declaration - Generated by piapp    */\n", fip);
+fputs("/*    -- Services2NObjMgr::PrepareNTExpressionCFile()  --       */ \n", fip);
+fputs("/* _nl line number or sequential index : _nstart <= _nl < _nend */ \n\n", fip);
+fprintf(fip,"int %s(int_8_exprf _nl, double* _xnti_, double* _rx_, double* _ry_, double* _rz_, \n", 
         funcname.c_str());
-fprintf(fip,"       double* _rt_, int _n_, int _nmax_) \n");
+fprintf(fip,"       double* _rt_, int_8_exprf _nstart, int_8_exprf _nend) \n");
 fprintf(fip, "{ \n %s \n", vardec.c_str());
 fputs("  if (!1) { /* Cut Expression failed */ \n", fip);
@@ -1178,12 +1179,12 @@
 float  fxnt[10];
 
-int i,k;
-for(i=0; i<10; i++) xnt[i] = 0.;
-int k1,k2,dk;
+int_8 k;
+for(k=0; k<10; k++) xnt[k] = 0.;
+int_8 k1,k2,dk;
 k1 = 0;  k2 = objnt->NbLines();  dk = 1;
 DecodeLoopParameters(loop, k1, k2, dk);
 if (k1 < 0) k1 = 0;
 if (k2 < 0) k2 = objnt->NbLines();
-if (k2 > (int_4)objnt->NbLines()) k2 = objnt->NbLines();
+if (k2 > (int_8)objnt->NbLines()) k2 = objnt->NbLines();
 if (dk <= 0) dk = 1;
 
@@ -1192,7 +1193,7 @@
   for(k=k1; k<k2; k += dk)    {
     xn = objnt->GetLineD(k);
-    if (f(xn, xnt, xnt+1, xnt+2, xnt+3) != 0) {
+    if (f((int_8_exprf)k,xn, xnt, xnt+1, xnt+2, xnt+3) != 0) {
       if (nt) { 
-         for(i=0; i<4; i++) fxnt[i] = xnt[i]; 
+         for(int i=0; i<4; i++) fxnt[i] = xnt[i]; 
          nt->Fill(fxnt);
          }
@@ -1251,7 +1252,7 @@
 
 fputs("/* ------ Compare bits on double --------- */ \n", fip);
-fputs("typedef long long int_8;\n", fip);
-fputs("int_8 BitCmp64(double v,int_8 flg)\n", fip);
-fputs("{return ((int_8)((v<0.) ? v-0.1 : v+0.1))&flg;}\n", fip);
+fputs("typedef long long int_8_exprf;\n", fip);
+fputs("int_8_exprf BitCmp64(double v,int_8_exprf flg)\n", fip);
+fputs("{return ((int_8_exprf)((v<0.) ? v-0.1 : v+0.1))&flg;}\n", fip);
 fputs("/* ------ Some random number generators --------- */ \n", fip);
 fputs("#if defined(__ppc__) && defined(__MACH__) \n",fip);
@@ -1273,5 +1274,5 @@
 fputs("#define gaurand() NorRand() \n\n", fip);
 
-fputs("int expf_pia_dl_func(double* _zz6qi_, double* _rx_6q_, double* _ry_6q_, double* _rz_6q_, double* _rt_6q_) \n{\n", fip);
+fputs("int expf_pia_dl_func(int_8_exprf _nl, double* _zz6qi_, double* _rx_6q_, double* _ry_6q_, double* _rz_6q_, double* _rt_6q_) \n{\n", fip);
 fprintf(fip,"%s \n", vardec.c_str());
 fprintf(fip, "if (!(%s)) { *_rx_6q_ = *_ry_6q_ = *_rz_6q_ = *_rt_6q_ = 0.;  return(0); } \n", cut.c_str());
@@ -1323,5 +1324,5 @@
 // Fonction static
 /* --Methode-- */
-void Services2NObjMgr::DecodeLoopParameters(string& loop, int& i1, int& i2, int& di)
+void Services2NObjMgr::DecodeLoopParameters(string& loop, int_8& i1, int_8& i2, int_8& di)
 {
 // Decode des paramatres de boucle for(int i=i1; i<i2; i+=di) specifies 
@@ -1331,13 +1332,13 @@
 if (l < 1) return;
 size_t p = loop.find(':');
-if (p >= l) { i1 = atoi(loop.c_str()); return; }
-i1 = atoi(loop.substr(0, p).c_str());
+if (p >= l) { i1 = atol(loop.c_str()); return; }
+i1 = atol(loop.substr(0, p).c_str());
 string aa = loop.substr(p+1);
 p = aa.find(':');
 if (p < aa.length() ) { 
-  i2 = atoi(aa.substr(0,p).c_str());
-  di = atoi(aa.substr(p+1).c_str());
-  }
-else i2 = atoi(aa.c_str());
+  i2 = atol(aa.substr(0,p).c_str());
+  di = atol(aa.substr(p+1).c_str());
+  }
+else i2 = atol(aa.c_str());
 // cout << "-> I1= " << i1 << " I2= " << i2 << " DI= " << di << endl; 
 return;
Index: trunk/SophyaPI/PIext/servnobjm.h
===================================================================
--- trunk/SophyaPI/PIext/servnobjm.h	(revision 2402)
+++ trunk/SophyaPI/PIext/servnobjm.h	(revision 2419)
@@ -115,5 +115,5 @@
 
 // Utilitaires divers 
-  static void   DecodeLoopParameters(string& loop, int& i1, int& i2, int& di);
+  static void   DecodeLoopParameters(string& loop, int_8& i1, int_8& i2, int_8& di);
   string 	FileName2Name(string const & fn);
   char* 	PClassIdToClassName(int cid);
