Aggiunto metodo TSystemisamfile::build(long, const TTrec&), per
la costruzione di files non ancora presenti in TRC.GEN. Corretta la exec_convapp(), prima di chiamare il programma per convertire il livello controlla che esso esista, in caso contrario non segnala alcun errore. Questa necessita' e dovuta alla separazione dei programmi di conversione per modulo: BACNV, 77CNV ecc. git-svn-id: svn://10.65.10.50/trunk@4629 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									d9a95aa969
								
							
						
					
					
						commit
						73a8cf70c6
					
				@ -1611,16 +1611,12 @@ int TIsamtempfile::close()
 | 
				
			|||||||
// TSystemsamfile
 | 
					// TSystemsamfile
 | 
				
			||||||
///////////////////////////////////////////////////////////
 | 
					///////////////////////////////////////////////////////////
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int TSystemisamfile::build(TRecnotype eox)
 | 
					int TSystemisamfile::build(TRecnotype eox, const TTrec& r)
 | 
				
			||||||
  
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  CHECKS(filehnd() == NULL, "Can't build open file", (const char*)filename());
 | 
					  CHECKS(filehnd() == NULL, "Can't build open file", (const char*)filename());
 | 
				
			||||||
  int err=NOERR;
 | 
					  int err=NOERR;
 | 
				
			||||||
  TDir d;
 | 
					  TDir d;
 | 
				
			||||||
  TTrec r;
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  d.get(num());
 | 
					  d.get(num());
 | 
				
			||||||
  r.get(num());
 | 
					 | 
				
			||||||
  CHECK(r.len() != 0, "Can't create a file with empty field info");
 | 
					  CHECK(r.len() != 0, "Can't create a file with empty field info");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  TFilename f(d.name());
 | 
					  TFilename f(d.name());
 | 
				
			||||||
@ -1658,6 +1654,13 @@ int TSystemisamfile::build(TRecnotype eox)
 | 
				
			|||||||
  return err;
 | 
					  return err;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int TSystemisamfile::build(TRecnotype eox)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  TTrec r;
 | 
				
			||||||
 | 
					  r.get(num());
 | 
				
			||||||
 | 
					  return build(eox,r);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int TSystemisamfile::extend(TRecnotype eox)
 | 
					int TSystemisamfile::extend(TRecnotype eox)
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
@ -1716,10 +1719,15 @@ int TSystemisamfile::exec_convapp(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (!conv.new_paragraph() && conv.exist(v, num()))
 | 
					    if (!conv.new_paragraph() && conv.exist(v, num()))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      TString80 s(conv.get(v, NULL, num())); s << " " << main_app().get_firm();
 | 
					      TToken_string s(conv.get(v, NULL, num()), ' ');
 | 
				
			||||||
 | 
					      TFilename f(s.get(0));
 | 
				
			||||||
 | 
					      f.ext(".exe");
 | 
				
			||||||
 | 
					      s << " " << main_app().get_firm();
 | 
				
			||||||
      TExternal_app app(s);
 | 
					      TExternal_app app(s);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (app.can_run())
 | 
					      if (app.can_run())
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        if (fexist(f))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          app.run();
 | 
					          app.run();
 | 
				
			||||||
          err = app.error();
 | 
					          err = app.error();
 | 
				
			||||||
@ -1728,6 +1736,7 @@ int TSystemisamfile::exec_convapp(
 | 
				
			|||||||
          if (err == 0 && msg != NULL)
 | 
					          if (err == 0 && msg != NULL)
 | 
				
			||||||
            err = atoi(msg->body());
 | 
					            err = atoi(msg->body());
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      else err = 16;
 | 
					      else err = 16;
 | 
				
			||||||
      if (err && err != 8)
 | 
					      if (err && err != 8)
 | 
				
			||||||
        return error_box("Impossibile eseguire il programma di %sconversione\ndel livello %ld/%ld\nErrore n.ro %d", before ? "pre" : "post", l / 100, l % 100, err); 
 | 
					        return error_box("Impossibile eseguire il programma di %sconversione\ndel livello %ld/%ld\nErrore n.ro %d", before ? "pre" : "post", l / 100, l % 100, err); 
 | 
				
			||||||
 | 
				
			|||||||
@ -604,7 +604,9 @@ class TSystemisamfile : public TIsamfile
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// @access Public Member
 | 
					// @access Public Member
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
  // @cmember Costruisce un file isam di dimensione <p eox>
 | 
					  // @cmember Costruisce un file isam di dimensione <p eox> sulla base del tracciato <p r> passato
 | 
				
			||||||
 | 
					  int build(TRecnotype eox, const TTrec& r);
 | 
				
			||||||
 | 
					  // @cmember Costruisce un file isam di dimensione <p eox>.
 | 
				
			||||||
  int build(TRecnotype eox);
 | 
					  int build(TRecnotype eox);
 | 
				
			||||||
  // @cmember Estende un file preesistente alla dimensione <p eox>
 | 
					  // @cmember Estende un file preesistente alla dimensione <p eox>
 | 
				
			||||||
  int extend(TRecnotype eox);
 | 
					  int extend(TRecnotype eox);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user