git-svn-id: svn://10.65.10.50/branches/R_10_00@23751 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									7fcdcc999f
								
							
						
					
					
						commit
						ae3ad3cfc2
					
				@ -1170,7 +1170,12 @@ bool TAlex_virtual_machine::execute(const TBytecode& bc)
 | 
			
		||||
 | 
			
		||||
bool TAlex_virtual_machine::compile(const char* cmd, TBytecode& bc)
 | 
			
		||||
{
 | 
			
		||||
#ifdef LINUX
 | 
			
		||||
	string s(cmd);
 | 
			
		||||
  istringstream instr(s);
 | 
			
		||||
#else
 | 
			
		||||
  istrstream instr((const char*)cmd, strlen(cmd));
 | 
			
		||||
#endif
 | 
			
		||||
  return compile(instr, bc);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -301,7 +301,6 @@ void TApplication::stop_run()
 | 
			
		||||
  xvt_app_destroy();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
bool TApplication::add_menu(TString_array& menu, MENU_TAG id)
 | 
			
		||||
{
 | 
			
		||||
  TTemp_window tw(TASK_WIN);
 | 
			
		||||
@ -316,11 +315,10 @@ bool TApplication::remove_menu(MENU_TAG id)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
TApplication::TApplication()
 | 
			
		||||
            : _god_vars(NULL),_savefirm(0), _running(FALSE), _create_ok(FALSE)
 | 
			
		||||
            : _god_vars(NULL),_savefirm(0), _running(false), _create_ok(false), _force(false)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
TApplication::~TApplication()
 | 
			
		||||
{
 | 
			
		||||
  if (_god_vars != NULL)
 | 
			
		||||
@ -341,6 +339,7 @@ void TApplication::terminate()
 | 
			
		||||
  if (_create_ok)
 | 
			
		||||
    destroy();                    // Distruzione files e maschere
 | 
			
		||||
 | 
			
		||||
  if(!_force)
 | 
			
		||||
		do_events();
 | 
			
		||||
 | 
			
		||||
  if (use_files())
 | 
			
		||||
@ -584,6 +583,7 @@ void TApplication::run(
 | 
			
		||||
  set_xvt_hooks();
 | 
			
		||||
 | 
			
		||||
  _running = TRUE;
 | 
			
		||||
	message_box("a");
 | 
			
		||||
  xvt_app_create(argc, argv, 0L, task_eh, &cfg);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -51,6 +51,9 @@ class TApplication
 | 
			
		||||
 | 
			
		||||
  // @cmember:(INTERNAL) Codice della ditta
 | 
			
		||||
  long _savefirm;
 | 
			
		||||
	// @cmember:(INTERNAL) Chiusura forzata per programmi senza interfaccia
 | 
			
		||||
  bool _force;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  // @cmember:(INTERNAL) Indica se l'applicazione e' partita
 | 
			
		||||
  bool _running;
 | 
			
		||||
@ -135,6 +138,8 @@ public:
 | 
			
		||||
                                    
 | 
			
		||||
  // @cmember Forza la chiusura dell'applicazione  
 | 
			
		||||
  void stop_run();
 | 
			
		||||
	void TApplication::force_stop() {_force = true;}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  // @cmember Mette il segno Check a fianco di una voce di menu
 | 
			
		||||
  void check_menu_item(MENU_TAG item, bool on = true);
 | 
			
		||||
 | 
			
		||||
@ -29,5 +29,7 @@
 | 
			
		||||
#define CAU_CODCAUREG  "CODCAUREG"
 | 
			
		||||
#define CAU_REGSPIVA	 "REGSPIVA"
 | 
			
		||||
#define CAU_MOVCGIND   "MOVCGIND"
 | 
			
		||||
#define CAU_RILFTEMRI	 "RILFTEMRI"
 | 
			
		||||
#define CAU_DATAREGPR  "DATAREGPR"
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
@ -17,7 +17,7 @@
 | 
			
		||||
#include <strings.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
enum TDongleHardware { _dongle_unknown=0, _dongle_network=3, _dongle_ssa=4, _dongle_ssanet=5 };
 | 
			
		||||
enum TDongleHardware { _dongle_unknown, _dongle_hardlock, _dongle_eutron, _dongle_network, _dongle_ssa, _dongle_ssanet,_dongle_software };
 | 
			
		||||
enum TDongleType { _no_dongle, _user_dongle, _developer_dongle };
 | 
			
		||||
 | 
			
		||||
class TDongle : public TObject
 | 
			
		||||
 | 
			
		||||
@ -26,3 +26,5 @@ BEGIN
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
#include <navbar.h>
 | 
			
		||||
 | 
			
		||||
// leave a newline at the end
 | 
			
		||||
 | 
			
		||||
@ -122,7 +122,11 @@ void fraction::build_fraction (const char *s)
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		n.strip(",.-+/[]");
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
	  sscanf_s(n, "%I64d", &_num);
 | 
			
		||||
#else	  
 | 
			
		||||
	  sscanf_s(n, "%Ld", &_num);
 | 
			
		||||
#endif
 | 
			
		||||
		if (len_periodo > 0)
 | 
			
		||||
		{
 | 
			
		||||
			_den = 9;
 | 
			
		||||
@ -174,6 +178,7 @@ fraction::fraction(const real& num, const real& den)
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int fraction::sign() const
 | 
			
		||||
{
 | 
			
		||||
	if (_num == 0 || _den == 0)
 | 
			
		||||
 | 
			
		||||
@ -985,7 +985,7 @@ int TBaseisamfile::_rewrite(const TRectype& rec)
 | 
			
		||||
 | 
			
		||||
  // Forza l'uso della chiave principale (per chiavi duplicate?)
 | 
			
		||||
  const int fhnd = handle(1);
 | 
			
		||||
  _lasterr = cisread(fhnd, 1, save_rec, _isequal + _nolock, _recno); // Si Posiziona per sicurezza...
 | 
			
		||||
  while ((_lasterr = cisread(fhnd, 1, save_rec, _isequal + _testandlock, _recno)) == _islocked) ;// Si Posiziona  e locca per sicurezza...
 | 
			
		||||
  
 | 
			
		||||
  if (_lasterr == NOERR)
 | 
			
		||||
  {
 | 
			
		||||
@ -1276,11 +1276,7 @@ int TBaseisamfile::is_valid(bool exclusive)
 | 
			
		||||
		  {
 | 
			
		||||
		    const int dbfreclen = DB_reclen(fhnd);
 | 
			
		||||
			  if (dbfreclen != trcreclen)
 | 
			
		||||
        {
 | 
			
		||||
				  err = _istrcerr;
 | 
			
		||||
          if (_logicnum == LF_CLIFO)
 | 
			
		||||
            error_box("Clifo trc=%d dbf=%d", trcreclen, dbfreclen);
 | 
			
		||||
        }
 | 
			
		||||
			}    
 | 
			
		||||
		}
 | 
			
		||||
    else
 | 
			
		||||
 | 
			
		||||
@ -198,3 +198,6 @@
 | 
			
		||||
#define CNF_DITTA   CNF_GENERAL + 2
 | 
			
		||||
 | 
			
		||||
#endif  // __LFFILES_H
 | 
			
		||||
 | 
			
		||||
// leave a newline at the end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -32,3 +32,5 @@ BEGIN
 | 
			
		||||
  MESSAGE EXIT,K_END
 | 
			
		||||
	PICTURE TOOL_LASTREC
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
// leave a newline at the end
 | 
			
		||||
 | 
			
		||||
@ -368,7 +368,12 @@ bool TPostman::dispatch_transaction(const TRectype& rec,
 | 
			
		||||
			TSocketClient socket;
 | 
			
		||||
			char * buf = new char[1024 * 256];
 | 
			
		||||
 | 
			
		||||
#ifdef WIN32  
 | 
			
		||||
      ostrstream stream(buf, 1024 * 256);
 | 
			
		||||
#else
 | 
			
		||||
      ostringstream stream(buf);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
			bool ok = true;
 | 
			
		||||
			
 | 
			
		||||
			item.SetTag("m:CampoTransaction");
 | 
			
		||||
 | 
			
		||||
@ -495,7 +495,7 @@ const TFilename& TFile_info::load_filedes()
 | 
			
		||||
  {
 | 
			
		||||
    _dir = _filedes.SysName[0] != '$' ? _comdir : _nordir;
 | 
			
		||||
    _name = CAddPref(_filedes.SysName);
 | 
			
		||||
    strncpy(_filedes.Des, dictionary_translate(_filedes.Des), sizeof(_filedes.Des)-1);
 | 
			
		||||
    strncpy_s(_filedes.Des, dictionary_translate(_filedes.Des), sizeof(_filedes.Des)-1);
 | 
			
		||||
  }
 | 
			
		||||
  else
 | 
			
		||||
    _name.cut(0);
 | 
			
		||||
@ -534,7 +534,7 @@ TFile_info::TFile_info(int logicnum, TFilename& name)
 | 
			
		||||
      int err = DB_recinfo(_name, &_filedes, (RecDes*)&rec.rec(), keys.get_buffer());
 | 
			
		||||
      if (err == NOERR && prefix().add_recdes(logicnum, rec, keys))
 | 
			
		||||
      {
 | 
			
		||||
        strncpy(_filedes.SysName, _name, sizeof(_filedes.SysName));
 | 
			
		||||
        strncpy_s(_filedes.SysName, _name, sizeof(_filedes.SysName));
 | 
			
		||||
        _filedes.SysName[41] = '\0';
 | 
			
		||||
      }
 | 
			
		||||
      else
 | 
			
		||||
@ -1036,7 +1036,7 @@ void TPrefix::set(
 | 
			
		||||
    {
 | 
			
		||||
      const TString saved_prf = __ptprf;  // Salvo __ptprf che viene cambiato da CGetPref
 | 
			
		||||
      char* prfx = (char*)CGetPref();     // Safe non const cast for StPath cprefix
 | 
			
		||||
      strcpy(__ptprf, saved_prf);
 | 
			
		||||
      strcpy_s(__ptprf, saved_prf);
 | 
			
		||||
      xvt_fsys_build_pathname(prfx, NULL, __ptprf, _prefix, NULL, NULL);
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
 | 
			
		||||
@ -891,11 +891,7 @@ void TPrint_application::set_row (
 | 
			
		||||
        if (ch == 't' || ch == 'a')
 | 
			
		||||
          formato << 's';
 | 
			
		||||
        else if (ch == 'r')
 | 
			
		||||
#ifdef __LONGDOUBLE__
 | 
			
		||||
          formato << "Lf";
 | 
			
		||||
#else        
 | 
			
		||||
          formato << 't';
 | 
			
		||||
#endif          
 | 
			
		||||
        else
 | 
			
		||||
          formato << ch;
 | 
			
		||||
        if (ccc == '%')
 | 
			
		||||
@ -954,13 +950,7 @@ void TPrint_application::set_row (
 | 
			
		||||
                    q = rrr.string(_picture);
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {   
 | 
			
		||||
#ifdef __LONGDOUBLE__ 
 | 
			
		||||
                  q.format(formato, (long double)rrr);
 | 
			
		||||
#else        
 | 
			
		||||
                  q = rrr.format(formato);
 | 
			
		||||
#endif          
 | 
			
		||||
                }
 | 
			
		||||
                if (rrr.is_zero () && !_print_zero)
 | 
			
		||||
                  q.fill (' ', q.len());
 | 
			
		||||
              }
 | 
			
		||||
@ -1481,13 +1471,7 @@ bool TPrint_application::print_one (
 | 
			
		||||
            ps = rrr.string(_picture);
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {       
 | 
			
		||||
#ifdef __LONGDOUBLE__      
 | 
			
		||||
          ps.format(fff, (long double)rrr);
 | 
			
		||||
#else            
 | 
			
		||||
	        ps = rrr.format(fff);
 | 
			
		||||
#endif
 | 
			
		||||
        }
 | 
			
		||||
        if (rrr.is_zero () && !_print_zero)
 | 
			
		||||
          ps.fill (' ', ps.len());
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
@ -47,6 +47,11 @@
 | 
			
		||||
#define RDOC_MOVMAG         "MOVMAG"
 | 
			
		||||
#define RDOC_CODMAGC        "CODMAGC"
 | 
			
		||||
#define RDOC_DATACONS       "DATACONS"
 | 
			
		||||
#define RDOC_QTAGG1         "QTAGG1"
 | 
			
		||||
#define RDOC_QTAGG2         "QTAGG2"
 | 
			
		||||
#define RDOC_QTAGG3         "QTAGG3"
 | 
			
		||||
#define RDOC_QTAGG4         "QTAGG4"
 | 
			
		||||
#define RDOC_QTAGG5         "QTAGG5"
 | 
			
		||||
#define RDOC_IMPIANTO       "IMPIANTO"
 | 
			
		||||
#define RDOC_LINEA          "LINEA"
 | 
			
		||||
#define RDOC_IDRIGA         "IDRIGA"
 | 
			
		||||
 | 
			
		||||
@ -3,381 +3,40 @@
 | 
			
		||||
#include <strings.h>
 | 
			
		||||
 | 
			
		||||
const real ZERO(0.0);
 | 
			
		||||
const real PUNTO_UNO(UNO/DIECI);
 | 
			
		||||
const real PUNTO_DUE(DUE/DIECI);
 | 
			
		||||
const real PUNTO_TRE(TRE/DIECI);
 | 
			
		||||
const real PUNTO_QUATTRO(DUE/CINQUE);
 | 
			
		||||
const real MEZZO(UNO/DUE);
 | 
			
		||||
const real PUNTO_SEI(TRE/CINQUE);
 | 
			
		||||
const real PUNTO_SETTE(SETTE/DIECI);
 | 
			
		||||
const real PUNTO_OTTO(QUATTRO/CINQUE);
 | 
			
		||||
const real PUNTO_NOVE(NOVE/DIECI);
 | 
			
		||||
const real UNO(1.0);
 | 
			
		||||
const real DUE(2.0);
 | 
			
		||||
const real TRE(3.0);
 | 
			
		||||
const real QUATTRO(4.0);
 | 
			
		||||
const real CINQUE(5.0);
 | 
			
		||||
const real SEI(6.0);
 | 
			
		||||
const real SETTE(7.0);
 | 
			
		||||
const real OTTO(8.0);
 | 
			
		||||
const real NOVE(9.0);
 | 
			
		||||
const real DIECI(10.0);
 | 
			
		||||
const real UNDICI(11.0);
 | 
			
		||||
const real DODICI(12.0);
 | 
			
		||||
const real TREDICI(13.0);
 | 
			
		||||
const real QUATTORDICI(14.0);
 | 
			
		||||
const real QUINDICI(15.0);
 | 
			
		||||
const real SEDICI(16.0);
 | 
			
		||||
const real DICIASSETTE(17.0);
 | 
			
		||||
const real DICIOTTO(18.0);
 | 
			
		||||
const real DICIANNOVE(19.0);
 | 
			
		||||
const real VENTI(20.0);
 | 
			
		||||
const real VENTUNO(21.0);
 | 
			
		||||
const real VENTIDUE(22.0);
 | 
			
		||||
const real CINQUANTA(50.0);
 | 
			
		||||
const real CENTO(100.0);
 | 
			
		||||
 | 
			
		||||
#ifdef __LONGDOUBLE__
 | 
			
		||||
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
inline long double _atold(const char* str)
 | 
			
		||||
{
 | 
			
		||||
  long double num = 0.0;
 | 
			
		||||
  sscanf(str, "%Lf", &num);
 | 
			
		||||
  return num;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
real::real () : _dec(0.0)
 | 
			
		||||
{ }
 | 
			
		||||
 | 
			
		||||
real::real (const real& b) : _dec(b._dec)
 | 
			
		||||
{ }
 | 
			
		||||
 | 
			
		||||
real::real (long double a) : _dec(a)
 | 
			
		||||
{ }
 | 
			
		||||
 | 
			
		||||
void real::set_int64(__int64 b)
 | 
			
		||||
{
 | 
			
		||||
	_dec = (long double)b;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool real::is_real (const char *s)
 | 
			
		||||
{             
 | 
			
		||||
  if (s && *s)
 | 
			
		||||
  {  
 | 
			
		||||
    const long double n = _atold(s);
 | 
			
		||||
    if (n == 0.0)
 | 
			
		||||
    {
 | 
			
		||||
      for(; *s; s++) 
 | 
			
		||||
      {
 | 
			
		||||
        if (strchr("0. ", *s) == NULL)
 | 
			
		||||
          return false;
 | 
			
		||||
      }
 | 
			
		||||
    }    
 | 
			
		||||
  }  
 | 
			
		||||
  return true;
 | 
			
		||||
}               
 | 
			
		||||
 | 
			
		||||
real::real (const char *s)
 | 
			
		||||
{                        
 | 
			
		||||
  _dec = (s && *s) ? _atold(s) : 0.0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
real& real::operator = (const real& b)
 | 
			
		||||
{
 | 
			
		||||
  _dec = b._dec;
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
real& real::operator = (long double b)
 | 
			
		||||
{
 | 
			
		||||
  _dec = b;
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
real& real::operator += (long double b)
 | 
			
		||||
{     
 | 
			
		||||
  _dec += b;
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
real& real::operator -= (long double b)
 | 
			
		||||
{     
 | 
			
		||||
  _dec -= b;
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
real& real::operator *= (long double b)
 | 
			
		||||
{
 | 
			
		||||
  _dec *= b;
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
real& real::operator /= (long double b)
 | 
			
		||||
{ 
 | 
			
		||||
  CHECK(b != 0.0, "Division by zero");
 | 
			
		||||
  _dec /= b;
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// @doc EXTERNAL
 | 
			
		||||
 | 
			
		||||
// @mfunc Ritorna il segno del reale                       
 | 
			
		||||
//
 | 
			
		||||
// @rdesc Ritorna i seguenti valori:
 | 
			
		||||
// 
 | 
			
		||||
// @flag <lt> 0 | Se il numero e' minore di 0
 | 
			
		||||
// @flag = 0 | Se il numero e' uguale a 0
 | 
			
		||||
// @flag <gt> 0 | Se il numero e' maggiore di 0
 | 
			
		||||
int real::sign () const
 | 
			
		||||
{
 | 
			
		||||
  const int s = _dec > 0.0 ? +1 : (_dec < 0.0 ? -1 : 0);
 | 
			
		||||
  return s;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
real real::operator - () const
 | 
			
		||||
{
 | 
			
		||||
  real n(-_dec);
 | 
			
		||||
  return n;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
long real::integer () const
 | 
			
		||||
{
 | 
			
		||||
  return (long)floorl(_dec);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Certified 91%
 | 
			
		||||
// @doc EXTERNAL
 | 
			
		||||
 | 
			
		||||
// @mfunc Trasforma un reale in stringa
 | 
			
		||||
//
 | 
			
		||||
// @rdesc Ritorna la stringa nella lunghezza richiesta
 | 
			
		||||
const char *real::string (
 | 
			
		||||
  int len,        // @parm Lunghezza della stringa (compreso decimali)
 | 
			
		||||
  int dec,        // @parm Numero di decimali (default UNDEFINED)
 | 
			
		||||
  char pad) const // @parm Carattere di riempimento (default ' ')
 | 
			
		||||
  // @parm char * | picture | Formato della stringa
 | 
			
		||||
 | 
			
		||||
  // @syntax string (int len, int dec, char pad);
 | 
			
		||||
  // @syntax string (const char *picture);
 | 
			
		||||
  //
 | 
			
		||||
  // @comm Nel primo caso ritorna una stringa lunga <p len> con <p dec> decimali e
 | 
			
		||||
  //       inserisce nella stringa stessa il carattere <p pad> nel caso la
 | 
			
		||||
  //       lunghezza richiesta sia maggiore di quella che risulterebbe per la
 | 
			
		||||
  //       completa rappresentazione del reale.
 | 
			
		||||
  //       <nl>Nel secondo caso ritorna la stringa con il formato stabilito in
 | 
			
		||||
  //       <p picture>.
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  TString16 fmt("%");
 | 
			
		||||
  if (pad != ' ') fmt << '0';
 | 
			
		||||
  if (len != 0) fmt << len;
 | 
			
		||||
  if (dec != UNDEFINED) fmt << '.' << dec;
 | 
			
		||||
  fmt << "Lf";
 | 
			
		||||
 | 
			
		||||
  TString& tmp = get_tmp_string();
 | 
			
		||||
	char* __string = tmp.get_buffer(len);
 | 
			
		||||
 | 
			
		||||
  sprintf(__string, fmt, _dec);
 | 
			
		||||
 | 
			
		||||
  if (len == 0 && dec == UNDEFINED && strchr(__string, '.') != NULL)
 | 
			
		||||
  {
 | 
			
		||||
    int cut = strlen (__string);
 | 
			
		||||
    for (int i = cut-1; i >= 0; i--)
 | 
			
		||||
    {
 | 
			
		||||
      if (__string[i] == '0')
 | 
			
		||||
        cut--;
 | 
			
		||||
      else
 | 
			
		||||
      {
 | 
			
		||||
        if(__string[i] == '.')
 | 
			
		||||
          cut--;
 | 
			
		||||
        break;
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
    __string[cut] = '\0';
 | 
			
		||||
  }
 | 
			
		||||
  return __string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Childish algorithm faster and more accurate than powl(10.0, pow)
 | 
			
		||||
HIDDEN void ipow10(int pow, double& m, double& d)
 | 
			
		||||
{
 | 
			
		||||
  m = d = 1.0;
 | 
			
		||||
  if (pow > 0)
 | 
			
		||||
  {
 | 
			
		||||
    for (int i = pow; i > 0; i--)
 | 
			
		||||
    {
 | 
			
		||||
      m *= 10.0;
 | 
			
		||||
      d *= 0.1;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  else
 | 
			
		||||
  {
 | 
			
		||||
    for (int i = pow; i < 0; i++)   
 | 
			
		||||
    {
 | 
			
		||||
      m *= 0.1;
 | 
			
		||||
      d *= 10.0;
 | 
			
		||||
    }
 | 
			
		||||
  }        
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int real::precision() const
 | 
			
		||||
{
 | 
			
		||||
  const TFixed_string s(string());
 | 
			
		||||
  const int d = s.find('.');
 | 
			
		||||
  const int p = d < 0 ? 0 : (s.len()-d-1);
 | 
			
		||||
  return p;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// @doc EXTERNAL
 | 
			
		||||
 | 
			
		||||
// @mfunc real& | real | round | Arrotonda al numero di decimali passati
 | 
			
		||||
real& real::round (
 | 
			
		||||
  int prec)  // @parm Numero di decimali a cui arrotondare il numero (default 0)
 | 
			
		||||
 | 
			
		||||
  // @comm Nel caso <p prec> sia:    
 | 
			
		||||
  //
 | 
			
		||||
  // @flag <gt> 0 | Arrotonda al decimale
 | 
			
		||||
  // @flag = 0 | Arrotonda all'intero
 | 
			
		||||
  // @flag <lt> 0  | Arrotonda al valore passato (es. -3 arrotonda alle mille)
 | 
			
		||||
{    
 | 
			
		||||
  if (abs(prec) < 20)
 | 
			
		||||
  {
 | 
			
		||||
    double m, d;
 | 
			
		||||
    if (prec != 0)
 | 
			
		||||
    {                  
 | 
			
		||||
      ipow10(prec, m, d);
 | 
			
		||||
      if (prec < 0)
 | 
			
		||||
        _dec /= d;
 | 
			
		||||
      else  
 | 
			
		||||
        _dec *= m;
 | 
			
		||||
    }  
 | 
			
		||||
 | 
			
		||||
    if (_dec >= 0.0)
 | 
			
		||||
      _dec = floorl(_dec + 0.5);
 | 
			
		||||
    else
 | 
			
		||||
      _dec = ceill(_dec - 0.5);  
 | 
			
		||||
    
 | 
			
		||||
    if (prec != 0)
 | 
			
		||||
		{
 | 
			
		||||
      if (prec < 0)
 | 
			
		||||
        _dec *= d;
 | 
			
		||||
      else  
 | 
			
		||||
        _dec /= m;
 | 
			
		||||
		}
 | 
			
		||||
  }  
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
real& real::ceil (int prec)
 | 
			
		||||
{
 | 
			
		||||
  double m, d;
 | 
			
		||||
  if (prec != 0)
 | 
			
		||||
  {
 | 
			
		||||
    ipow10(prec, m, d);
 | 
			
		||||
    _dec *= m;
 | 
			
		||||
  }
 | 
			
		||||
  _dec = ceill(_dec);
 | 
			
		||||
  if (prec != 0)
 | 
			
		||||
//      _dec *= d;   Risulta stranamente molto impreciso!
 | 
			
		||||
    _dec /= m;
 | 
			
		||||
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
real& real::floor (int prec)
 | 
			
		||||
{
 | 
			
		||||
  double m, d;
 | 
			
		||||
  if (prec != 0)
 | 
			
		||||
  {
 | 
			
		||||
    ipow10(prec, m, d);
 | 
			
		||||
    _dec *= m;
 | 
			
		||||
  }
 | 
			
		||||
  _dec = floorl(_dec);
 | 
			
		||||
  if (prec != 0)
 | 
			
		||||
//      _dec *= d;   Risulta stranamente molto impreciso!
 | 
			
		||||
    _dec /= m;
 | 
			
		||||
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
real& real::trunc(int prec)
 | 
			
		||||
{
 | 
			
		||||
  double m, d;
 | 
			
		||||
  if (prec != 0)
 | 
			
		||||
  {
 | 
			
		||||
    ipow10(prec, m, d);
 | 
			
		||||
    _dec *= m;
 | 
			
		||||
  }
 | 
			
		||||
  _dec = floorl(_dec);
 | 
			
		||||
  if (prec != 0)
 | 
			
		||||
//      _dec *= d;   Risulta stranamente molto impreciso!
 | 
			
		||||
    _dec /= m;
 | 
			
		||||
  return *this;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// @doc EXTERNAL
 | 
			
		||||
 | 
			
		||||
// @func Scambia il numero reale <p a> con il numero real <p b>
 | 
			
		||||
void swap (
 | 
			
		||||
  real& a,  // @parm Primo numero da scambiare
 | 
			
		||||
  real& b)  // @parm Secondo numero da scambiare
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  const real n = a;
 | 
			
		||||
  a = b;
 | 
			
		||||
  b = n;
 | 
			
		||||
}           
 | 
			
		||||
 | 
			
		||||
long double operator%(const real& a, const real& b)
 | 
			
		||||
{
 | 
			
		||||
  const long double times = floorl(a / b);
 | 
			
		||||
  const long double resto = (double)a - (double)b * times;
 | 
			
		||||
  return resto;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
long double sqr(long double a)
 | 
			
		||||
{
 | 
			
		||||
  return a*a;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
long double exp10(long double a) 
 | 
			
		||||
{
 | 
			
		||||
  return powl(10.0, a);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if _MSC_VER < 1300
 | 
			
		||||
 | 
			
		||||
long double sqrt(long double a) 
 | 
			
		||||
{  
 | 
			
		||||
  return sqrtl(a); 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
long double pow(long double a, long double b)
 | 
			
		||||
{
 | 
			
		||||
  return powl(a, b);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
long double exp(long double a) 
 | 
			
		||||
{
 | 
			
		||||
  return expl(a);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
long double log10(long double a)
 | 
			
		||||
{
 | 
			
		||||
  return log10l(a);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
long double log(long double a)
 | 
			
		||||
{                             
 | 
			
		||||
  return logl(a);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
long double sin(long double a)
 | 
			
		||||
{
 | 
			
		||||
  return sinl(a);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
long double cos(long double a)
 | 
			
		||||
{
 | 
			
		||||
  return cosl(a);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
long double tan(long double a)
 | 
			
		||||
{
 | 
			
		||||
  return tanl(a);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
long double abs(long double a)
 | 
			
		||||
{
 | 
			
		||||
  return fabsl(a);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
#include <gm.h>
 | 
			
		||||
//#include <ctype.h>
 | 
			
		||||
//#include <stdlib.h>
 | 
			
		||||
@ -1254,8 +913,6 @@ const char* real::format(const char *picture) const
 | 
			
		||||
  return (const char *) f;
 | 
			
		||||
}                 
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Funzioni comuni dei due real
 | 
			
		||||
 | 
			
		||||
TObject* real::dup () const
 | 
			
		||||
@ -1511,6 +1168,15 @@ HIDDEN int get_picture_decimals (const TString& picture, char& decsep)
 | 
			
		||||
  return decimali;
 | 
			
		||||
}           
 | 
			
		||||
 | 
			
		||||
long double real::ld() const
 | 
			
		||||
{
 | 
			
		||||
	TString20 str = string();
 | 
			
		||||
	long double num;
 | 
			
		||||
 | 
			
		||||
  sscanf(str, "%Lf", &num);
 | 
			
		||||
  return num;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char* real::string(const char *picture) const
 | 
			
		||||
{
 | 
			
		||||
  if (*picture == '\0')
 | 
			
		||||
@ -1868,12 +1534,3 @@ int TImporto::compare(const TSortable& s) const
 | 
			
		||||
  const int res = d.sign();
 | 
			
		||||
  return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool TImporto::is_zero() const
 | 
			
		||||
{ 
 | 
			
		||||
#ifdef __LONGDOUBLE__
 | 
			
		||||
  return fabsl(_valore) < 0.00001;
 | 
			
		||||
#else
 | 
			
		||||
  return _valore.is_zero(); 
 | 
			
		||||
#endif  
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -12,168 +12,40 @@
 | 
			
		||||
class real;
 | 
			
		||||
 | 
			
		||||
extern const real ZERO;
 | 
			
		||||
extern const real PUNTO_UNO;
 | 
			
		||||
extern const real PUNTO_DUE;
 | 
			
		||||
extern const real PUNTO_TRE;
 | 
			
		||||
extern const real PUNTO_QUATTRO;
 | 
			
		||||
extern const real MEZZO;
 | 
			
		||||
extern const real PUNTO_SEI;
 | 
			
		||||
extern const real PUNTO_SETTE;
 | 
			
		||||
extern const real PUNTO_OTTO;
 | 
			
		||||
extern const real PUNTO_NOVE;
 | 
			
		||||
extern const real UNO;
 | 
			
		||||
extern const real DUE;
 | 
			
		||||
extern const real TRE;
 | 
			
		||||
extern const real QUATTRO;
 | 
			
		||||
extern const real CINQUE;
 | 
			
		||||
extern const real SEI;
 | 
			
		||||
extern const real SETTE;
 | 
			
		||||
extern const real OTTO;
 | 
			
		||||
extern const real NOVE;
 | 
			
		||||
extern const real DIECI;
 | 
			
		||||
extern const real UNDICI;
 | 
			
		||||
extern const real DODICI;
 | 
			
		||||
extern const real TREDICI;
 | 
			
		||||
extern const real QUATTORDICI;
 | 
			
		||||
extern const real QUINDICI;
 | 
			
		||||
extern const real SEDICI;
 | 
			
		||||
extern const real DICIASSETTE;
 | 
			
		||||
extern const real DICIOTTO;
 | 
			
		||||
extern const real DICIANNOVE;
 | 
			
		||||
extern const real VENTI;
 | 
			
		||||
extern const real VENTUNO;
 | 
			
		||||
extern const real VENTIDUE;
 | 
			
		||||
extern const real CINQUANTA;
 | 
			
		||||
extern const real CENTO;
 | 
			
		||||
 | 
			
		||||
#ifdef __LONGDOUBLE__
 | 
			
		||||
 | 
			
		||||
// @doc EXTERNAL
 | 
			
		||||
 | 
			
		||||
// @class real | Classe per la gestione dei numeri reali
 | 
			
		||||
//
 | 
			
		||||
// @base public | TObject
 | 
			
		||||
class real : public TObject
 | 
			
		||||
 | 
			
		||||
// @comm Questa classe utilizza i long double definiti per Visual C++. Esiste un'altra classe
 | 
			
		||||
//     real: per accedere scegliere il tasto successivo (<gt><gt>) dalla barra dei bottoni
 | 
			
		||||
 | 
			
		||||
// @author:(INTERNAL) Guido
 | 
			
		||||
{
 | 
			
		||||
  // @access:(INTERNAL) Private Member
 | 
			
		||||
 | 
			
		||||
  // @cmember:(INTERNAL) Numero reale
 | 
			
		||||
  long double _dec;
 | 
			
		||||
 | 
			
		||||
  // @access Protected Member
 | 
			
		||||
protected:                             
 | 
			
		||||
  // @cmember Permette di stampare l'oggetto
 | 
			
		||||
  virtual void print_on(ostream& out) const;
 | 
			
		||||
 | 
			
		||||
  // @cmember Duplica il numero reale (vedi classe <c TObject>)
 | 
			
		||||
  virtual TObject* dup() const;
 | 
			
		||||
  // @cmember Traduce in lettere il numero reale
 | 
			
		||||
  const char* literals() const;
 | 
			
		||||
  // @cmember Inserisce i punti separatori delle migliaia e riempe i decimali
 | 
			
		||||
  //          alla lunghezza passata (es: 3.000,20)
 | 
			
		||||
  const char* points(int decimals = 0) const;
 | 
			
		||||
 | 
			
		||||
  // @access Public Member
 | 
			
		||||
public:
 | 
			
		||||
  // @cmember long double | operator long double | | Ritorna il numero reale
 | 
			
		||||
  operator long double () const
 | 
			
		||||
  { return _dec; }
 | 
			
		||||
 | 
			
		||||
  // @cmember Trasforma un numero dal formato inglese (decimali con punto) in
 | 
			
		||||
  //          formato italiano (decimali con virgola)
 | 
			
		||||
  static const char* eng2ita(char* s);
 | 
			
		||||
  // @cmember Trasforma un numero dal formato italiano (decimali con virgola) in
 | 
			
		||||
  //          formato inglese (decimali con punto)
 | 
			
		||||
  static const char* ita2eng(const char* s);
 | 
			
		||||
  // @cmember Controlla se si tratta di un numero reale (TRUE se vero)
 | 
			
		||||
  static bool is_real(const char* n);
 | 
			
		||||
  // @cmember Controlla se si tratta di un numero naturale (TRUE se vero)
 | 
			
		||||
  static bool is_natural(const char* n);
 | 
			
		||||
  // @cmember Controlla se si tratta di uno zero (TRUE se vero)
 | 
			
		||||
  static bool is_null(const char* n);
 | 
			
		||||
  // @cmember Trasforma un reale in stringa
 | 
			
		||||
  const char* string(int len = 0, int dec = UNDEFINED, char pad = ' ') const;
 | 
			
		||||
  // @cmember Trasforma un reale in stringa (chiama <mf real::string>), 
 | 
			
		||||
  //           ma ritorna il formato italiano
 | 
			
		||||
  const char* stringa(int len = 0, int dec = UNDEFINED, char pad = ' ') const;
 | 
			
		||||
  // @cmember Trasforma un reale in stringa (chiama <mf real::string>), 
 | 
			
		||||
  //          ma ritorna il formato atteso da Excel
 | 
			
		||||
  const char* stringe(int len = 0, int dec = UNDEFINED, char pad = ' ') const;
 | 
			
		||||
  // @cmember Ritorna la stringa con il formato passato
 | 
			
		||||
  const char* string(const char* picture) const;
 | 
			
		||||
  // @cmember Ritorna la stringa con il formato passato
 | 
			
		||||
  const char* format(const char *picture) const;
 | 
			
		||||
 | 
			
		||||
  // @cmember Ritorna la precisione del reale (numero di decimali)
 | 
			
		||||
  int precision() const;
 | 
			
		||||
  // @cmember Controlla se si tratta di un reale uguale a 0
 | 
			
		||||
  bool is_zero() const { return _dec == ZERO; }
 | 
			
		||||
  // @cmember Controlla se si tratta di un reale diverso da 0
 | 
			
		||||
	bool not_zero() const { return !is_zero();}
 | 
			
		||||
  // @cmember Ritorna il segno del reale
 | 
			
		||||
  int sign() const;
 | 
			
		||||
  // @cmember Trasforma il reale in intero (operator int era troppo pericoloso)
 | 
			
		||||
  long integer() const;
 | 
			
		||||
 | 
			
		||||
  // @cmember Arrotonda al numero di decimali passati
 | 
			
		||||
  real& round(int prec = 0) ;
 | 
			
		||||
  // @cmember Tronca al numero di decimali passati (default 0)
 | 
			
		||||
  real& trunc(int prec = 0) ;
 | 
			
		||||
  // @cmember Arrotonda al numero successivo (della precisione passata)
 | 
			
		||||
  real& ceil(int prec = 0);
 | 
			
		||||
  // @cmember Arrotonda al numero precedente (della precisione passata)
 | 
			
		||||
  real& floor(int prec = 0);
 | 
			
		||||
  // @cmember Assegna un reale
 | 
			
		||||
  real& operator = (const real& a);
 | 
			
		||||
  // @cmember Assegna un reale
 | 
			
		||||
  real& operator =(long double a);
 | 
			
		||||
  // @cmember Assegna un __int64 ad un reale
 | 
			
		||||
  void set_int64(__int64 b);
 | 
			
		||||
  // @cmember Aggiunge ad un reale il valore passato (passato per indirizzo)
 | 
			
		||||
  real& operator +=(long double a);
 | 
			
		||||
  // @cmember Sottrae ad un reale il valore passato (passato per indirizzo)
 | 
			
		||||
  real& operator -=(long double b);
 | 
			
		||||
  // @cmember Moltiplica un reale per il valore passato (passato per indirizzo)
 | 
			
		||||
  real& operator *=(long double b);
 | 
			
		||||
  // @cmember Divide un reale per il valore passato (passato per indirizzo)
 | 
			
		||||
  real& operator /=(long double b);
 | 
			
		||||
  // @cmember Ritorna la negazione di un reale (TRUE se 0, altrimenti FALSE)
 | 
			
		||||
  bool operator !() const
 | 
			
		||||
  { return _dec == ZERO; }
 | 
			
		||||
  // @cmember Ritorna il risultato della differenza tra due reali
 | 
			
		||||
  real operator -() const;
 | 
			
		||||
  
 | 
			
		||||
  // @cmember Costruttore
 | 
			
		||||
  real();
 | 
			
		||||
  // @cmember Costruttore
 | 
			
		||||
  real(const real& b);
 | 
			
		||||
  // @cmember Costruttore
 | 
			
		||||
  real(long double a);
 | 
			
		||||
  // @cmember Costruttore
 | 
			
		||||
  real(const char* s);
 | 
			
		||||
  // @cmember Distruttore
 | 
			
		||||
  virtual ~real()
 | 
			
		||||
  {}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
inline long double fnc_min(long double a, long double b){ return a < b ? a : b; }
 | 
			
		||||
inline long double fnc_max(long double a, long double b) { return a > b ? a : b; }
 | 
			
		||||
 | 
			
		||||
inline bool operator <(const real& a, const real& b) {return (double)a < (double)b;}
 | 
			
		||||
inline bool operator <(double a, const real& b) {return a < (double)b;}
 | 
			
		||||
inline bool operator >(const real& a, const real& b) {return (double)a > (double)b;}
 | 
			
		||||
inline bool operator >(double a, const real& b) {return a > (double)b;}
 | 
			
		||||
inline bool operator <=(const real& a, const real& b) {return (double)a <= (double)b;}
 | 
			
		||||
inline bool operator <=(double a, const real& b) {return a <= (double)b;}
 | 
			
		||||
inline bool operator >=(const real& a, const real& b) {return (double)a >= (double)b;}
 | 
			
		||||
inline bool operator >=(double a, const real& b) {return a >= (double)b;}
 | 
			
		||||
inline bool operator ==(const real& a, const real& b) {return (double)a == (double)b;}
 | 
			
		||||
inline bool operator ==(double a, const real& b) {return a == (double)b;}
 | 
			
		||||
inline bool operator !=(const real& a, const real& b) {return (double)a != (double)b;}
 | 
			
		||||
inline bool operator !=(double a, const real& b) {return a != (double)b;}
 | 
			
		||||
 | 
			
		||||
inline real operator +(const real& a, const real& b) {return (double)a + (double)b;}
 | 
			
		||||
inline real operator -(const real& a, const real& b) {return (double)a - (double)b;}
 | 
			
		||||
inline real operator *(const real& a, const real& b) {return (double)a * (double)b;}
 | 
			
		||||
inline real operator /(const real& a, const real& b) {return (double)a / (double)b;}
 | 
			
		||||
 | 
			
		||||
long double operator%(const real& a, const real& b);
 | 
			
		||||
void swap(real& a, real& b) ;
 | 
			
		||||
long double sqr(long double) ;
 | 
			
		||||
long double exp10(long double) ;
 | 
			
		||||
 | 
			
		||||
#if _MSC_VER < 1300
 | 
			
		||||
long double sqrt(long double) ;
 | 
			
		||||
long double pow(long double, long double) ;
 | 
			
		||||
long double exp(long double a) ;
 | 
			
		||||
long double log10(long double a) ;
 | 
			
		||||
long double log(long double a) ;
 | 
			
		||||
long double sin(long double a) ;
 | 
			
		||||
long double cos(long double a) ;
 | 
			
		||||
long double tan(long double a) ;
 | 
			
		||||
long double abs(long double a) ;
 | 
			
		||||
#else
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
#ifndef INCSTR_H
 | 
			
		||||
#include <incstr.h>
 | 
			
		||||
#endif
 | 
			
		||||
@ -236,6 +108,8 @@ public:
 | 
			
		||||
  // @cmember Ritorna l'indirizzo del numero reale
 | 
			
		||||
  DEC* ptr() const
 | 
			
		||||
  { return (DEC*)&_dec; }
 | 
			
		||||
	 // @cmember Ritorna il numero reale convetito in long double
 | 
			
		||||
	long double ld() const;
 | 
			
		||||
  // @cmember Trasforma un reale in stringa
 | 
			
		||||
  const char* string(int len = 0, int dec = UNDEFINED, char pad = ' ') const;
 | 
			
		||||
  // @cmember Trasforma un reale in stringa (chiama <mf real::string>), ma
 | 
			
		||||
@ -359,8 +233,6 @@ real cos(const real& a) ;
 | 
			
		||||
real tan(const real& a) ;
 | 
			
		||||
real abs(const real& a) ;
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
class TDistrib : public TObject
 | 
			
		||||
 | 
			
		||||
// @author:(INTERNAL) Villa
 | 
			
		||||
@ -515,7 +387,7 @@ public:
 | 
			
		||||
  { return _valore; }
 | 
			
		||||
 | 
			
		||||
  // @cmember Controlla se l'importo e' 0 (in qualsiasi sezione, TRUE se 0)
 | 
			
		||||
  bool is_zero() const;
 | 
			
		||||
	bool is_zero() const { return _valore.is_zero(); } 
 | 
			
		||||
 | 
			
		||||
  // @cmember Assegna l'importo passato
 | 
			
		||||
  const TImporto& operator=(const TImporto& i)
 | 
			
		||||
 | 
			
		||||
@ -1558,8 +1558,12 @@ TCursor* TISAM_recordset::cursor() const
 | 
			
		||||
    TParagraph_string msg(use, 64);
 | 
			
		||||
    TPerformance_profiler prof(msg.get(0));
 | 
			
		||||
    TISAM_recordset* my = (TISAM_recordset*)this;
 | 
			
		||||
 | 
			
		||||
#ifdef LINUX
 | 
			
		||||
		string s(use.get_buffer());
 | 
			
		||||
    istringstream instr(s);
 | 
			
		||||
#else
 | 
			
		||||
    istrstream instr(use.get_buffer(), use.len()+1);  //"barata" x aggiungere il carattere finale
 | 
			
		||||
#endif
 | 
			
		||||
    TCursor_parser parser(instr, my->_column);
 | 
			
		||||
 | 
			
		||||
    my->_relation = parser.get_relation();
 | 
			
		||||
 | 
			
		||||
@ -1,2 +1,4 @@
 | 
			
		||||
#include <filebar.h>
 | 
			
		||||
#include <cancelbar.h>
 | 
			
		||||
 | 
			
		||||
// leave a newline at the end
 | 
			
		||||
 | 
			
		||||
@ -1413,12 +1413,25 @@ void TRelation_application::main_loop()
 | 
			
		||||
      }
 | 
			
		||||
  
 | 
			
		||||
      if (_curr_trans_mode == TM_BATCH)
 | 
			
		||||
      {
 | 
			
		||||
//      {
 | 
			
		||||
        batch();
 | 
			
		||||
        k = _mask->check_mask();
 | 
			
		||||
        batch(false);
 | 
			
		||||
/*				if (_mask->check_fields())
 | 
			
		||||
				{
 | 
			
		||||
					if (_curr_transaction == TRANSACTION_INSERT)
 | 
			
		||||
						k = K_INS;
 | 
			
		||||
					else
 | 
			
		||||
						if (_curr_transaction == TRANSACTION_MODIFY)
 | 
			
		||||
							k = K_ENTER;
 | 
			
		||||
						else
 | 
			
		||||
							if (_curr_transaction == TRANSACTION_DELETE)
 | 
			
		||||
								k = K_DEL;
 | 
			
		||||
							else
 | 
			
		||||
								k = K_ESC;
 | 
			
		||||
				}
 | 
			
		||||
				else
 | 
			
		||||
					k = K_ESC;
 | 
			
		||||
      }
 | 
			
		||||
      else */
 | 
			
		||||
			k = _mask->run();
 | 
			
		||||
  
 | 
			
		||||
      switch (k)
 | 
			
		||||
@ -1677,6 +1690,8 @@ void TRelation_application::main_loop()
 | 
			
		||||
      }   
 | 
			
		||||
      if (_curr_trans_mode == TM_BATCH)
 | 
			
		||||
      {
 | 
			
		||||
        batch(false);
 | 
			
		||||
 | 
			
		||||
				TString_array & errs = errors();
 | 
			
		||||
 | 
			
		||||
        FOR_EACH_ARRAY_ROW(errs, r, s)
 | 
			
		||||
@ -1691,6 +1706,8 @@ void TRelation_application::main_loop()
 | 
			
		||||
    }
 | 
			
		||||
    _trans_counter++;
 | 
			
		||||
  } while ( _trans_counter < _ntransactions);
 | 
			
		||||
  if (_curr_trans_mode == TM_BATCH)
 | 
			
		||||
		force_stop();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool TRelation_application::filter()
 | 
			
		||||
 | 
			
		||||
@ -79,6 +79,9 @@ public:
 | 
			
		||||
  virtual const TVariant& get(unsigned int column) const;
 | 
			
		||||
  virtual TRecnotype new_rec(const char* buf = NULL);
 | 
			
		||||
  virtual bool set(unsigned int fld, const TVariant& var);
 | 
			
		||||
  virtual bool set(const char* fld, const TVariant& var) { return TText_recordset::set(fld, var); }
 | 
			
		||||
  virtual bool set(const char* fld, const char * s) { const TVariant var(s); return TText_recordset::set(fld, var); }
 | 
			
		||||
  virtual bool set(const char* fld, const TString & s) { const TVariant var(s); return TText_recordset::set(fld, var); }
 | 
			
		||||
	virtual void destroy_column(const int ncol = -1, bool pack = true) { _trc.destroy(ncol, pack); }
 | 
			
		||||
	virtual void create_column(const char * name, TFieldtypes type = _alfafld);
 | 
			
		||||
  virtual bool load_file(const TFilename& n);
 | 
			
		||||
 | 
			
		||||
@ -53,3 +53,6 @@
 | 
			
		||||
#define VALIDATE        VA
 | 
			
		||||
#define WARNING         WA
 | 
			
		||||
#define ZOOM            ZO
 | 
			
		||||
 | 
			
		||||
// leave a newline at the end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -8,3 +8,5 @@
 | 
			
		||||
 | 
			
		||||
#undef min
 | 
			
		||||
#undef max
 | 
			
		||||
 | 
			
		||||
// leave a newline at the end
 | 
			
		||||
 | 
			
		||||
@ -209,4 +209,4 @@
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* @END */
 | 
			
		||||
// leave a newline at the end
 | 
			
		||||
 | 
			
		||||
@ -518,7 +518,11 @@ void TXmlItem::AsString(TString& str) const
 | 
			
		||||
	{
 | 
			
		||||
	  char* buf = str.get_buffer(nSize); 
 | 
			
		||||
		memset(buf, 0, nSize);
 | 
			
		||||
#ifdef WIN32
 | 
			
		||||
		ostrstream outf(buf, nSize);
 | 
			
		||||
#else
 | 
			
		||||
		ostringstream outf(buf);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		Write(outf, 0);
 | 
			
		||||
		if (buf[nSize-1] == '\0')
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user