Files correlati :bainst.exe Ricompilazione Demo : [ ] Commento :sistemata la post-installazione in caso di installazione dati demo git-svn-id: svn://10.65.10.50/trunk@11364 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			69 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
#include <prefix.h>
 | 
						|
#include <inst.h>
 | 
						|
#include <modaut.h>
 | 
						|
#include <tabutil.h>
 | 
						|
#include "bainst.h"
 | 
						|
#include "bainst38.h"
 | 
						|
 | 
						|
class TInstall_SV : public TInstallmodule_app
 | 
						|
{
 | 
						|
protected:
 | 
						|
  virtual int module_number() const {return SVAUT;}
 | 
						|
  virtual bool install_firm() {return TRUE;}
 | 
						|
  virtual bool install_com();
 | 
						|
  virtual bool load_default_data() const ;
 | 
						|
 
 | 
						|
public:
 | 
						|
  virtual ~TInstall_SV () {}
 | 
						|
};
 | 
						|
 | 
						|
bool TInstall_SV ::install_com() 
 | 
						|
{
 | 
						|
  // ciclo su ogni ditta
 | 
						|
  TStd_filename txtfile(module_code());
 | 
						|
  txtfile << "tab.txt";
 | 
						|
  if (txtfile.check(TRUE))
 | 
						|
  {
 | 
						|
    // carica le tabelle nei file di default
 | 
						|
    TSystemtempfile tabstd(LF_TAB);
 | 
						|
    TFilename stdtabname(prefix().get_studio());
 | 
						|
    stdtabname << "STD\\lf0005.txt";
 | 
						|
    tabstd.load(txtfile);
 | 
						|
    tabstd.load(stdtabname);
 | 
						|
    tabstd.set_autodel();
 | 
						|
    TFilename tempfile;
 | 
						|
    tempfile.temp();
 | 
						|
    
 | 
						|
    // riconverte le macro delle date
 | 
						|
    tabstd.dump(tempfile);
 | 
						|
    TScanner scan(tempfile);
 | 
						|
    FILE *dest=fopen((const char *)stdtabname,"w");
 | 
						|
    while (TRUE) {
 | 
						|
      TString &line=scan.line();
 | 
						|
      if (line.empty()) break;
 | 
						|
 | 
						|
      int pos=(line.find("-0000"));
 | 
						|
      while (pos >= 0 )
 | 
						|
      {
 | 
						|
        line.overwrite("%yr%",pos+1);
 | 
						|
        pos=(line.find("-0000"));
 | 
						|
      }
 | 
						|
      line << '\n' ;
 | 
						|
      fputs((const char * )line,dest);
 | 
						|
    } 
 | 
						|
    fclose(dest);
 | 
						|
  }
 | 
						|
  return TRUE;
 | 
						|
}
 | 
						|
 | 
						|
bool TInstall_SV ::load_default_data() const
 | 
						|
{        
 | 
						|
  return TRUE;
 | 
						|
}
 | 
						|
 | 
						|
int bainst38(int argc, char** argv)
 | 
						|
{ 
 | 
						|
  TInstall_SV app;
 | 
						|
  app.run(argc, argv);
 | 
						|
  return 0;
 | 
						|
} |