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:
angelo 1997-06-12 15:52:14 +00:00
parent d9a95aa969
commit 73a8cf70c6
2 changed files with 26 additions and 15 deletions

View File

@ -1611,18 +1611,14 @@ int TIsamtempfile::close()
// 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());
int err=NOERR;
TDir d;
TTrec r;
d.get(num());
r.get(num());
CHECK(r.len() != 0, "Can't create a file with empty field info");
TFilename f(d.name());
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;
}
int TSystemisamfile::build(TRecnotype eox)
{
TTrec r;
r.get(num());
return build(eox,r);
}
int TSystemisamfile::extend(TRecnotype eox)
@ -1716,17 +1719,23 @@ int TSystemisamfile::exec_convapp(
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);
if (app.can_run())
{
app.run();
err = app.error();
TMailbox mail;
TMessage* msg = mail.next(TRUE);
if (err == 0 && msg != NULL)
err = atoi(msg->body());
if (fexist(f))
{
app.run();
err = app.error();
TMailbox mail;
TMessage* msg = mail.next(TRUE);
if (err == 0 && msg != NULL)
err = atoi(msg->body());
}
}
else err = 16;
if (err && err != 8)
@ -1947,7 +1956,7 @@ int TSystemisamfile::update(
wrec.put(num());
if (toconvert && dir.eox() > 0L) packindex();
if (err == NOERR)
err = exec_convapp(lev, FALSE);
err = exec_convapp(lev, FALSE);
}
setstatus(err);
return err;

View File

@ -604,7 +604,9 @@ class TSystemisamfile : public TIsamfile
// @access Public Member
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);
// @cmember Estende un file preesistente alla dimensione <p eox>
int extend(TRecnotype eox);