ba1301 Tolta cgettime da programma di test isam

ba3100 Corretta gestione bottone di configurazione stampa registri
bacnvid Aggiunti controlli sui files senza tracciato
batbreg Aggiunto acceleratore alt-s sul bottone di configurazione stampante


git-svn-id: svn://10.65.10.50/trunk@1546 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-07-03 16:16:48 +00:00
parent bca2780adb
commit 55394b9fac
4 changed files with 391 additions and 402 deletions

View File

@ -329,12 +329,12 @@ void TTestProc::do_test_2()
void TTestProc::DumpReport(int err, long i, long x, int key)
{
static rnum=0;
char ora[10];
char ora[12] = "08-08-1883";
TString RandomFile,ReportFile;
FILE * fp;
get_win()->WriteW(33,15,(const char*)TString(35).format("File nr. %d Test nr. %ld",_nfile,_ntest));
cgettime(ora);
if (!fexist("test")) // create directory
#if XVT_OS==XVT_OS_SCOUNIX
mkdir("test",0777);

View File

@ -120,9 +120,11 @@ HIDDEN bool printer_handler(TMask_field& f, KEY k)
TPrinter& p = printer();
p.set_printtype(normprinter); // Force configuration update
p.read_configuration(config);
p.set();
m.enable(F_CONFIG);
m.set(F_CONFIG, "X");
if (p.set())
{
m.enable(F_CONFIG);
m.set(F_CONFIG, "X");
}
p.read_configuration();
}
else
@ -142,12 +144,12 @@ HIDDEN bool impdel_handler(TMask_field& f, KEY k)
if (tipo_del == 1 || tipo_del == 7)
{
const double lim[2] = { 50000.0, 200000.0};
const int t = tipo_del == 1 ? 0 : 1;
const real imp(m.get(F_IMPORTO));
const double lim[2] = { 50000.0, 200000.0};
if (imp < lim[t])
return yesno_box("Importo inferiore a Lit. %s. Vuoi registrare lo stesso ?", real(lim[t]).string("."));
return yesno_box("Importo inferiore a Lit. %s. Registrare ugualmente?", real(lim[t]).string("."));
}
}
return TRUE;

View File

@ -225,9 +225,10 @@ int TIsam_date_converter::Iconvert_file(int logicnum)
r.get(logicnum);
RecDes *rd=r.rec();
const int nflds = r.fields();
const int nkeys = r.keys();
dir.get(logicnum);
if (dir.len() == 0) return 0;
if (dir.len() == 0 || nflds < 1 || nkeys < 1) return 0;
const char * fp = dir.name();
TFilename old(fp);
const TRecnotype nitems = dir.eod();
@ -237,37 +238,24 @@ int TIsam_date_converter::Iconvert_file(int logicnum)
if (fexist(old))
{
f.open(old);
{
TSystemisamfile newfile(logicnum);
{
TSystemisamfile newfile(logicnum);
if (newfile.build(10) != NOERR)
fatal_box("Non riesco a creare il file %s : errore n. %d", fp, newfile.status());
}
if (newfile.build(10) != NOERR)
fatal_box("Non riesco a creare il file %s : errore n. %d", fp, newfile.status());
}
char * _field= new char [r.len()];
TString s(80);
TToken_string ts(128); // Build token_string with the names of date fields
for (int j=0; j<r.fields(); j++)
if (rd->Fd[j].TypeF == _datefld)
ts.add(rd->Fd[j].Name);
s.format("Aggiornamento archivio %s", fp);
TProgind p((long)(nitems ? nitems : 1), s, TRUE, TRUE, 70);
TProgind p((long)(nitems ? nitems : 1), s, FALSE, TRUE, 70);
TLocalisamfile newfile(logicnum);
TRecnotype i;
for (i = 1; newfile.good() && i <= dir.eod(); i++)
{
f.read(newfile.curr().string(),i);
ts.restart();
if (newfile.curr().string()[0] == NULL)
{
for (int j=0; j<ts.items(); j++)
{
CGetFieldBuff((char*)ts.get(),rd,newfile.curr().string(),_field);
newfile.curr().put(ts.get(j),_field);
}
if (newfile.curr().string()[0] == '\0')
newfile.curr().recall();
}
else
newfile.curr().discard();
if ((i % 50) == 0) p.setstatus((long)(i + 1));
@ -276,8 +264,6 @@ int TIsam_date_converter::Iconvert_file(int logicnum)
}
p.setstatus((long)nitems);
f.close();
if (_field != NULL)
delete _field;
if (newfile.good())
{
old.ext("dta");
@ -326,9 +312,10 @@ void TIsam_date_converter::Dconvert_file(int logicnum)
r.get(logicnum);
RecDes *rd=r.rec();
const int nflds = r.fields();
const int nkeys = r.keys();
dir.get(logicnum);
if (dir.len() == 0) return;
if (dir.len() == 0 || nflds < 1 || nkeys < 1) return;
const TRecnotype nitems = dir.eod();
const char* file_name = dir.name();

View File

@ -230,14 +230,14 @@ BEGIN
VALIDATE NOT_EMPTY_CHECK_FIELD
END
BUTTON F_PRINTER 32 2
BEGIN
PROMPT 1 17 "Configurazione stampante"
END
BOOLEAN F_CONFIG
BEGIN
PROMPT 40 17 "Stampante configurata"
PROMPT 1 17 "Stampante configurata"
END
BUTTON F_PRINTER 30 2
BEGIN
PROMPT 40 17 "Configurazione ~stampante"
END
ENDPAGE