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,16 +1611,12 @@ 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());
@ -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,10 +1719,15 @@ 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())
{
if (fexist(f))
{
app.run();
err = app.error();
@ -1728,6 +1736,7 @@ int TSystemisamfile::exec_convapp(
if (err == 0 && msg != NULL)
err = atoi(msg->body());
}
}
else err = 16;
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);

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);