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,18 +1611,14 @@ 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());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  f = f.path(); if (!is_not_slash(f.right(1)[0])) f.rtrim(1);
 | 
					  f = f.path(); if (!is_not_slash(f.right(1)[0])) f.rtrim(1);
 | 
				
			||||||
@ -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,17 +1719,23 @@ 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())
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        app.run();
 | 
					        if (fexist(f))
 | 
				
			||||||
        err = app.error();
 | 
					        {
 | 
				
			||||||
        TMailbox mail;
 | 
					          app.run();
 | 
				
			||||||
        TMessage* msg = mail.next(TRUE);
 | 
					          err = app.error();
 | 
				
			||||||
        if (err == 0 && msg != NULL)
 | 
					          TMailbox mail;
 | 
				
			||||||
          err = atoi(msg->body());
 | 
					          TMessage* msg = mail.next(TRUE);
 | 
				
			||||||
 | 
					          if (err == 0 && msg != NULL)
 | 
				
			||||||
 | 
					            err = atoi(msg->body());
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      else err = 16;
 | 
					      else err = 16;
 | 
				
			||||||
      if (err && err != 8)
 | 
					      if (err && err != 8)
 | 
				
			||||||
@ -1947,7 +1956,7 @@ int TSystemisamfile::update(
 | 
				
			|||||||
    wrec.put(num());
 | 
					    wrec.put(num());
 | 
				
			||||||
    if (toconvert && dir.eox() > 0L) packindex();
 | 
					    if (toconvert && dir.eox() > 0L) packindex();
 | 
				
			||||||
    if (err == NOERR)
 | 
					    if (err == NOERR)
 | 
				
			||||||
      err = exec_convapp(lev, FALSE);            
 | 
					        err = exec_convapp(lev, FALSE);            
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  setstatus(err);
 | 
					  setstatus(err);
 | 
				
			||||||
  return err;
 | 
					  return 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