Aggiunta la funzione setfiler.

Aggiornato l'uso della funzione filter e setregion


git-svn-id: svn://10.65.10.50/trunk@72 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1994-08-26 14:06:07 +00:00
parent fe146577cf
commit 10cb8b20f6
17 changed files with 4639 additions and 4555 deletions

View File

@ -1,4 +1,4 @@
// ba3200 Stampa tabelle
// ba3200 Stampa tabelle
//
// legge un file con estensione .rpt che descrive la stampa.
// Vedi file leggimi.txt per il formato del file
@ -17,25 +17,25 @@
class BA3200_application : public TPrintapp
{
// TTable* _tab;
TString _tabname;
TFilename _rptname;
TRelation* _rel;
// TTable* _tab;
TString _tabname;
TFilename _rptname;
TRelation* _rel;
TCursor *_cur;
TMask* _msk;
TString _maskname;
// TScanner *_rpt;
TMask* _msk;
TString _maskname;
// TScanner *_rpt;
int _logicnum;
public:
virtual void user_create() ;
virtual void user_destroy() ;
virtual bool set_print(int) ;
virtual void user_create() ;
virtual void user_destroy() ;
virtual bool set_print(int) ;
virtual void set_page(int, int);
virtual void set_page(int, int);
void leggi_rpt();
void leggi_rpt();
void set_headers();
void set_rows();
void set_footers();
@ -61,15 +61,15 @@ bool BA3200_application::set_print(int)
{
const TMask_field& campo_maschera = _msk->fld(i);
const char* val = campo_maschera.get();
const TFieldref* campo_ref = campo_maschera.field();
const TFieldref* campo_ref = campo_maschera.field();
if (*val && campo_ref != NULL && campo_ref->ok())
{
if (campo_maschera.in_group(1)) campo_ref->write(val, from); else
if (campo_maschera.in_group(2)) campo_ref->write(val, to);
}
if (campo_maschera.in_group(1)) campo_ref->write(val, from); else
if (campo_maschera.in_group(2)) campo_ref->write(val, to);
}
}
_cur->filter ("", from.empty() ? NULL : &from, to.empty() ? NULL : &to);
_cur->setregion (from, to);
return TRUE;
}
return FALSE;
@ -77,14 +77,14 @@ bool BA3200_application::set_print(int)
void BA3200_application::set_page (int , int )
{
leggi_rpt();
leggi_rpt();
}
void BA3200_application::set_headers()
{
TString NomeTabella, sep, formato_intesta, testo_intesta;
int LungRiga, riga_intesta=0, last_riga=1;
TToken_string line;
TToken_string line;
reset_header ();
@ -117,7 +117,7 @@ void BA3200_application::set_headers()
testo_intesta = (const char *) line.get();
if (riga_intesta)
set_header (last_riga+riga_intesta, (const char *)formato_intesta,
(const char *)testo_intesta);
(const char *)testo_intesta);
line = rpt.line();
}
@ -131,8 +131,8 @@ void BA3200_application::set_headers()
void BA3200_application::set_rows()
{
TToken_string line;
TFieldref campo;
TToken_string line;
TFieldref campo;
int from, to, riga_record;
TString formato_campo, picture;
const char * name;
@ -150,7 +150,7 @@ void BA3200_application::set_rows()
to = campo.to();
name = campo.name();
formato_campo = line.get();
formato_campo = line.get();
formato_campo.trim();
if (formato_campo.lower() == "@pn")
@ -229,7 +229,7 @@ void BA3200_application::user_create()
fatal_box("Impossibile aprire il file '%s'", (const char*)_rptname);
// _tab = new TTable (_tabname);
// _tab = new TTable (_tabname);
_rel = new TRelation (_tabname);
_cur = new TCursor (_rel);
@ -256,7 +256,7 @@ void BA3200_application::user_destroy()
delete _msk;
delete _cur;
delete _rel;
// delete _tab;
// delete _tab;
}
int ba3200(int argc, char* argv[])

View File

@ -43,7 +43,7 @@ BEGIN
INPUT TIPOA "G"
INPUT CODANAGR FLD_CODANAGR
DISPLAY "Codice" CODANAGR
DISPLAY "Denominazione@50" RAGSOC
DISPLAY "Ragione sociale@50" RAGSOC
DISPLAY "Codice Fiscale@16" COFI
OUTPUT FLD_CODANAGR CODANAGR
OUTPUT FLD_AG1_RAGSOC RAGSOC
@ -64,7 +64,7 @@ BEGIN
INPUT TIPOA "G"
CHECKTYPE REQUIRED
INPUT RAGSOC FLD_AG1_RAGSOC
DISPLAY "Denominazione@50" RAGSOC
DISPLAY "Ragione sociale@50" RAGSOC
DISPLAY "Codice" CODANAGR
DISPLAY "Codice Fiscale " COFI
COPY OUTPUT FLD_CODANAGR
@ -115,7 +115,7 @@ BEGIN
INPUT TIPOA "G"
INPUT COFI FLD_AG1_COFI
DISPLAY "Codice Fiscale@16" COFI
DISPLAY "Denominazione@50" RAGSOC
DISPLAY "Ragione sociale@50" RAGSOC
DISPLAY "Codice" CODANAGR
COPY OUTPUT FLD_CODANAGR
CHECKTYPE REQUIRED
@ -1071,7 +1071,7 @@ END
STRING F_IMP_PROVCOM 5
BEGIN
PROMPT 64 6 "Prov."
PROMPT 62 6 "Prov."
FLAGS "D"
END
@ -1092,10 +1092,15 @@ BEGIN
WARNING "Ufficio imposte assente"
END
STRINF F_DENUFFIIDD 50
STRINF F_DENUFFIIDD 50 48
BEGIN
PROMPT 23 7 " "
FLAGS "D"
USE %UID KEY 2
INPUT S0 F_DENUFFIIDD
DISPLAY "Denominazione@50" S0
DISPLAY "Ufficio" CODTAB
DISPLAY "C.C.@8" S4
COPY OUTPUT F_UFFIIDD
END
STRING F_CC_ESATTORIA 8
@ -1115,7 +1120,7 @@ BEGIN
FLAGS "UDG"
END
STRING F_DENUFFREG 50
STRING F_DENUFFREG 50 48
BEGIN
PROMPT 24 9 ""
FLAGS "D"
@ -1132,7 +1137,7 @@ BEGIN
CHECKTYPE NORMAL
END
STRING F_DENUFFCONC 50
STRING F_DENUFFCONC 50 48
BEGIN
PROMPT 24 10 ""
FLAGS "D"
@ -1149,7 +1154,7 @@ BEGIN
CHECKTYPE NORMAL
END
STRING F_DENUFFSERV 50
STRING F_DENUFFSERV 50 48
BEGIN
PROMPT 24 11 ""
FLAGS "D"

View File

@ -309,7 +309,7 @@ STRING FLD_GD1_COMAA_COMUNI_DESCR 50
BEGIN
PROMPT 8 12 ": Nome "
USE LF_COMUNI KEY 2 SELECT STATO=""
INPUT COM FLD_GD1_COMAA_COMUNI_DESCR
INPUT DENCOM FLD_GD1_COMAA_COMUNI_DESCR
#include <comdden.h>
OUTPUT FLD_GD1_COMAA COM
OUTPUT FLD_GD1_COMAA_COMUNI_DESCR DENCOM

View File

@ -15,19 +15,19 @@ TRectype& BA6100_App::look_com(const char* cod)
{
_comuni->curr().zero();
if (*cod)
{
_comuni->curr().put("COM",cod);
_comuni->read();
if (_comuni->bad())
_comuni->curr().zero();
}
{
_comuni->curr().put("COM",cod);
_comuni->read();
if (_comuni->bad())
_comuni->curr().zero();
}
return _comuni->curr();
}
const char* BA6100_App::look_tab(const char* tabname, const char* cod,
const char* fld)
const char* fld)
{
if (*cod == 0) return "";
if (*cod == 0) return "";
TTable tab(tabname);
tab.curr().zero();
tab.curr().put("CODTAB",cod);
@ -40,24 +40,24 @@ const char* BA6100_App::look_tab(const char* tabname, const char* cod,
void BA6100_App::process_link(int id, const char* txt)
{
if (id == _ana_link)
{
TString ss = "1|"; ss << txt;
TMessage fs(cmd2name("ba4","-1"), MSG_LN, ss);
TMailbox m;
m.send(fs);
TExternal_app ba4(_pr_what == anafis ? "ba4 -1 F" : "ba4 -1 G");
if (ba4.run()) beep();
}
else if (id == _dit_link)
{
TString ss = "1|"; ss << txt << "|" << txt;
TMessage fs(cmd2name("ba4","-2"), MSG_LN, ss);
TMailbox m;
m.send(fs);
TExternal_app ba4("ba4 -2");
if (ba4.run()) beep();
}
if (id == _ana_link)
{
TString ss = "1|"; ss << txt;
TMessage fs(cmd2name("ba4","-1"), MSG_LN, ss);
TMailbox m;
m.send(fs);
TExternal_app ba4(_pr_what == anafis ? "ba4 -1 F" : "ba4 -1 G");
if (ba4.run()) beep();
}
else if (id == _dit_link)
{
TString ss = "1|"; ss << txt << "|" << txt;
TMessage fs(cmd2name("ba4","-2"), MSG_LN, ss);
TMailbox m;
m.send(fs);
TExternal_app ba4("ba4 -2");
if (ba4.run()) beep();
}
}
// ---- here we go -------------------------------------------------
@ -65,40 +65,40 @@ void BA6100_App::process_link(int id, const char* txt)
void BA6100_App::set_page(int file, int cnt)
{
switch(file)
{
case LF_ANAG:
case LF_NDITTE:
if (_pr_type == elenco)
{
case LF_ANAG:
case LF_NDITTE:
if (_pr_type == elenco)
{
if (_pr_what != nditte && file == LF_NDITTE)
{
set_row(1,"@50g$[r]@pN$[n]@66g@S", FLD(LF_NDITTE,"CODDITTA","@@@@@"),
FLD(LF_NDITTE,"RAGSOC"));
set_row(2,"");
}
else
set_elenco();
}
else if (_pr_type == rubriche) set_rubriche();
else if (_pr_type == schede)
{
if (_pr_what != nditte && file == LF_NDITTE)
set_scheda_ditta();
else
set_schede();
}
else if (_pr_type == etichette) set_etichette();
break;
case LF_ATTIV:
set_scheda_attiv();
break;
case LF_UNLOC:
set_scheda_unloc();
break;
case LF_SOCI:
set_scheda_socio();
break;
if (_pr_what != nditte && file == LF_NDITTE)
{
set_row(1,"@50g$[r]@pN$[n]@66g@S", FLD(LF_NDITTE,"CODDITTA","@@@@@"),
FLD(LF_NDITTE,"RAGSOC"));
set_row(2,"");
}
else
set_elenco();
}
else if (_pr_type == rubriche) set_rubriche();
else if (_pr_type == schede)
{
if (_pr_what != nditte && file == LF_NDITTE)
set_scheda_ditta();
else
set_schede();
}
else if (_pr_type == etichette) set_etichette();
break;
case LF_ATTIV:
set_scheda_attiv();
break;
case LF_UNLOC:
set_scheda_unloc();
break;
case LF_SOCI:
set_scheda_socio();
break;
}
}
@ -108,26 +108,26 @@ bool BA6100_App::preprocess_page(int file, int counter)
// che la stampa a fianco dell'anagrafica
if (file == LF_NDITTE && _pr_type == elenco && _inclditte
&& _pr_what != nditte)
if (current_cursor()->is_first_match(LF_NDITTE))
if (current_cursor()->is_first_match(LF_NDITTE))
return FALSE;
if (_pr_type == rubriche)
{
// vale per ditte, anagiu, anafis
_com = current_cursor()->curr(LF_ANAG).get("COMRES");
if (_com.empty())
_com = current_cursor()->curr(LF_ANAG).get("COMRF");
_phone = current_cursor()->curr(LF_ANAG).get("PTELRF");
_phone.trim();
if (!_phone.empty()) _phone << '/';
_phone << current_cursor()->curr(LF_ANAG).get("TELRF");
{
// vale per ditte, anagiu, anafis
_com = current_cursor()->curr(LF_ANAG).get("COMRES");
if (_com.empty())
_com = current_cursor()->curr(LF_ANAG).get("COMRF");
_phone = current_cursor()->curr(LF_ANAG).get("PTELRF");
_phone.trim();
if (!_phone.empty()) _phone << '/';
_phone << current_cursor()->curr(LF_ANAG).get("TELRF");
TRectype& cc = look_com(_com);
_com = cc.get("DENCOM");
_cap = cc.get("CAPCOM");
_prov = cc.get("PROVCOM");
}
else if (_pr_type == etichette)
TRectype& cc = look_com(_com);
_com = cc.get("DENCOM");
_cap = cc.get("CAPCOM");
_prov = cc.get("PROVCOM");
}
else if (_pr_type == etichette)
preprocess_etichette();
return TRUE;
}
@ -136,19 +136,19 @@ bool BA6100_App::preprocess_page(int file, int counter)
bool mask_reset_fields(TMask_field& mf, KEY k)
{
if (k == K_SPACE)
{
BA6100_App* a = (BA6100_App*)MainApp();
mf.mask().field(FLD_BA6B_INDROW).set(format("%d",a->_ind_row));
mf.mask().field(FLD_BA6B_INDCOL).set(format("%d",a->_ind_col));
mf.mask().field(FLD_BA6B_PIVROW).set(format("%d",a->_piv_row));
mf.mask().field(FLD_BA6B_PIVCOL).set(format("%d",a->_piv_col));
mf.mask().field(FLD_BA6B_CODROW).set(format("%d",a->_cod_row));
mf.mask().field(FLD_BA6B_CODCOL).set(format("%d",a->_cod_col));
mf.mask().field(FLD_BA6B_TOTROW).set(format("%d",a->_rows_et));
mf.mask().field(FLD_BA6B_TOTCOL).set(format("%d",a->_cols_et));
mf.mask().field(CHK_BA6B_PIVA).set(a->_is_piv ? "X" : " ");
mf.mask().field(CHK_BA6B_CODICE).set(a->_is_cod ?"X": " ");
}
{
BA6100_App* a = (BA6100_App*)MainApp();
mf.mask().field(FLD_BA6B_INDROW).set(format("%d",a->_ind_row));
mf.mask().field(FLD_BA6B_INDCOL).set(format("%d",a->_ind_col));
mf.mask().field(FLD_BA6B_PIVROW).set(format("%d",a->_piv_row));
mf.mask().field(FLD_BA6B_PIVCOL).set(format("%d",a->_piv_col));
mf.mask().field(FLD_BA6B_CODROW).set(format("%d",a->_cod_row));
mf.mask().field(FLD_BA6B_CODCOL).set(format("%d",a->_cod_col));
mf.mask().field(FLD_BA6B_TOTROW).set(format("%d",a->_rows_et));
mf.mask().field(FLD_BA6B_TOTCOL).set(format("%d",a->_cols_et));
mf.mask().field(CHK_BA6B_PIVA).set(a->_is_piv ? "X" : " ");
mf.mask().field(CHK_BA6B_CODICE).set(a->_is_cod ?"X": " ");
}
return TRUE;
}
@ -164,388 +164,387 @@ void BA6100_App::preprocess_etichette()
_cofi = get_field(LF_ANAG,"PAIV");
if (_pr_what == anafis)
{
_surname = _name.mid(30,50); _surname.trim();
_name = _name.mid(0,30); _name.trim();
}
{
_surname = _name.mid(30,50); _surname.trim();
_name = _name.mid(0,30); _name.trim();
}
switch (_ind_what)
{
case corrispondenza:
_address = get_field(LF_ANAG,"INDCORR");
_civ = get_field(LF_ANAG,"CIVCORR");
_stato = look_tab("%STA",get_field(LF_ANAG,"STATOCORR"));
_cap = get_field(LF_ANAG,"CAPCORR");
_com = cc.get("DENCOM");
_prov = cc.get("PROVCOM");
if (_cap.empty())
_cap = cc.get("CAPCOM");
if (!_address.empty())
break;
// else fall down
case domfisc:
_address = get_field(LF_ANAG,"INDRF");
_civ = get_field(LF_ANAG,"CIVRF");
_stato = look_tab("%STA",get_field(LF_ANAG,"STATORF"));
_cap = get_field(LF_ANAG,"CAPRF");
cc = look_com(get_field(LF_ANAG,"COMRF"));
_com = cc.get("DENCOM");
_prov = cc.get("PROVCOM");
if (_cap.empty())
_cap = cc.get("CAPCOM");
if (!_address.empty())
break;
// else fall down
case residenza:
_address = get_field(LF_ANAG,"INDRES");
_civ = get_field(LF_ANAG,"CIVRES");
_stato = look_tab("%STA",get_field(LF_ANAG,"STATORES"));
_cap = get_field(LF_ANAG,"CAPRES");
cc = look_com(get_field(LF_ANAG,"COMRES"));
_com = cc.get("DENCOM");
_prov = cc.get("PROVCOM");
if (_cap.empty())
_cap = cc.get("CAPCOM");
break;
}
{
case corrispondenza:
_address = get_field(LF_ANAG,"INDCORR");
_civ = get_field(LF_ANAG,"CIVCORR");
_stato = look_tab("%STA",get_field(LF_ANAG,"STATOCORR"));
_cap = get_field(LF_ANAG,"CAPCORR");
_com = cc.get("DENCOM");
_prov = cc.get("PROVCOM");
if (_cap.empty())
_cap = cc.get("CAPCOM");
if (!_address.empty())
break;
// else fall down
case domfisc:
_address = get_field(LF_ANAG,"INDRF");
_civ = get_field(LF_ANAG,"CIVRF");
_stato = look_tab("%STA",get_field(LF_ANAG,"STATORF"));
_cap = get_field(LF_ANAG,"CAPRF");
cc = look_com(get_field(LF_ANAG,"COMRF"));
_com = cc.get("DENCOM");
_prov = cc.get("PROVCOM");
if (_cap.empty())
_cap = cc.get("CAPCOM");
if (!_address.empty())
break;
// else fall down
case residenza:
_address = get_field(LF_ANAG,"INDRES");
_civ = get_field(LF_ANAG,"CIVRES");
_stato = look_tab("%STA",get_field(LF_ANAG,"STATORES"));
_cap = get_field(LF_ANAG,"CAPRES");
cc = look_com(get_field(LF_ANAG,"COMRES"));
_com = cc.get("DENCOM");
_prov = cc.get("PROVCOM");
if (_cap.empty())
_cap = cc.get("CAPCOM");
break;
}
}
void BA6100_App::init_print()
{
reset_print();
reset_files();
reset_print();
reset_files();
// select cursor and main file
switch(_pr_what)
{
case anafis:
select_cursor(cfis());
add_file(LF_ANAG);
break;
case anagiu:
select_cursor(cgiu());
add_file(LF_ANAG);
break;
case nditte:
select_cursor(cdit());
add_file(LF_NDITTE);
break;
}
// select cursor and main file
switch(_pr_what)
{
case anafis:
select_cursor(cfis());
add_file(LF_ANAG);
break;
case anagiu:
select_cursor(cgiu());
add_file(LF_ANAG);
break;
case nditte:
select_cursor(cdit());
add_file(LF_NDITTE);
break;
}
force_setpage(_pr_type == schede);
// setup secondary links
if (_inclditte)
{
switch(_pr_type)
{
case elenco:
if (_pr_what != nditte)
add_file(LF_NDITTE);
break;
case schede:
if (_pr_what != nditte)
add_file(LF_NDITTE);
add_file(LF_ATTIV,LF_NDITTE);
add_file(LF_UNLOC,LF_NDITTE);
add_file(LF_SOCI, LF_NDITTE);
break;
default:
break;
}
{
switch(_pr_type)
{
case elenco:
if (_pr_what != nditte)
add_file(LF_NDITTE);
break;
case schede:
if (_pr_what != nditte)
add_file(LF_NDITTE);
add_file(LF_ATTIV,LF_NDITTE);
add_file(LF_UNLOC,LF_NDITTE);
add_file(LF_SOCI, LF_NDITTE);
break;
default:
break;
}
}
set_headers();
}
bool BA6100_App::set_print(int)
{
TMask mask("ba6100a.msk");
// set print type
switch (mask.run())
{
case K_ESC:
case K_QUIT:
return FALSE;
case BUT_BA6_ELENCO:
_pr_type = elenco;
// cio' che e' blu collega al modulo anagrafiche
_ana_link = enable_link("Collegamento archivio anagrafiche: ", 'b');
_dit_link = enable_link("Collegamento archivio ditte: ", 'r');
break;
case BUT_BA6_SCHEDE:
disable_links();
_pr_type = schede;
break;
case BUT_BA6_ETICHETTE:
disable_links();
if (_pr_what != nditte)
{
_pr_type = etichette;
// set additionals
TMask mask2("ba6100b.msk");
// set print type
switch (mask.run())
{
case K_ESC:
case K_QUIT:
return FALSE;
case BUT_BA6_ELENCO:
_pr_type = elenco;
// cio' che e' blu collega al modulo anagrafiche
_ana_link = enable_link("Collegamento archivio anagrafiche: ", 'b');
_dit_link = enable_link("Collegamento archivio ditte: ", 'r');
break;
case BUT_BA6_SCHEDE:
disable_links();
_pr_type = schede;
break;
case BUT_BA6_ETICHETTE:
disable_links();
if (_pr_what != nditte)
{
_pr_type = etichette;
// set additionals
TMask mask2("ba6100b.msk");
mask2.set_workfile("ba6100.set");
mask2.set_handler(BUT_BA6B_RESET, mask_reset_fields);
mask2.set_workfile("ba6100.set");
mask2.set_handler(BUT_BA6B_RESET, mask_reset_fields);
if (fexist("ba6100b.set"))
{
mask2.load();
if (fexist("ba6100b.set"))
{
mask2.load();
_ind_what = (in)atoi(mask2.get(RDB_BA6B_INDIR));
_ind_row = atoi(mask2.get(FLD_BA6B_INDROW));
_piv_row = atoi(mask2.get(FLD_BA6B_PIVROW));
_cod_row = atoi(mask2.get(FLD_BA6B_CODROW));
_rows_et = atoi(mask2.get(FLD_BA6B_TOTROW));
_ind_col = atoi(mask2.get(FLD_BA6B_INDCOL));
_piv_col = atoi(mask2.get(FLD_BA6B_PIVCOL));
_cod_col = atoi(mask2.get(FLD_BA6B_CODCOL));
_cols_et = atoi(mask2.get(FLD_BA6B_TOTCOL));
_ind_what = (in)atoi(mask2.get(RDB_BA6B_INDIR));
_ind_row = atoi(mask2.get(FLD_BA6B_INDROW));
_piv_row = atoi(mask2.get(FLD_BA6B_PIVROW));
_cod_row = atoi(mask2.get(FLD_BA6B_CODROW));
_rows_et = atoi(mask2.get(FLD_BA6B_TOTROW));
_ind_col = atoi(mask2.get(FLD_BA6B_INDCOL));
_piv_col = atoi(mask2.get(FLD_BA6B_PIVCOL));
_cod_col = atoi(mask2.get(FLD_BA6B_CODCOL));
_cols_et = atoi(mask2.get(FLD_BA6B_TOTCOL));
_is_piv = mask2.get(CHK_BA6B_PIVA) == "X";
_is_cod = mask2.get(CHK_BA6B_CODICE) == "X";
}
else
{
mask2.field(FLD_BA6B_INDROW).set(format("%d",_ind_row));
mask2.field(FLD_BA6B_INDCOL).set(format("%d",_ind_col));
mask2.field(FLD_BA6B_PIVROW).set(format("%d",_piv_row));
mask2.field(FLD_BA6B_PIVCOL).set(format("%d",_piv_col));
mask2.field(FLD_BA6B_CODROW).set(format("%d",_cod_row));
mask2.field(FLD_BA6B_CODCOL).set(format("%d",_cod_col));
mask2.field(FLD_BA6B_TOTROW).set(format("%d",_rows_et));
mask2.field(FLD_BA6B_TOTCOL).set(format("%d",_cols_et));
mask2.field(CHK_BA6B_PIVA).set(_is_piv ? "X" : " ");
mask2.field(CHK_BA6B_CODICE).set(_is_cod ?"X": " ");
}
_is_piv = mask2.get(CHK_BA6B_PIVA) == "X";
_is_cod = mask2.get(CHK_BA6B_CODICE) == "X";
}
else
{
mask2.field(FLD_BA6B_INDROW).set(format("%d",_ind_row));
mask2.field(FLD_BA6B_INDCOL).set(format("%d",_ind_col));
mask2.field(FLD_BA6B_PIVROW).set(format("%d",_piv_row));
mask2.field(FLD_BA6B_PIVCOL).set(format("%d",_piv_col));
mask2.field(FLD_BA6B_CODROW).set(format("%d",_cod_row));
mask2.field(FLD_BA6B_CODCOL).set(format("%d",_cod_col));
mask2.field(FLD_BA6B_TOTROW).set(format("%d",_rows_et));
mask2.field(FLD_BA6B_TOTCOL).set(format("%d",_cols_et));
mask2.field(CHK_BA6B_PIVA).set(_is_piv ? "X" : " ");
mask2.field(CHK_BA6B_CODICE).set(_is_cod ?"X": " ");
}
mask2.run();
mask2.run();
_ind_what = (in)atoi(mask2.get(RDB_BA6B_INDIR));
_ind_row = atoi(mask2.get(FLD_BA6B_INDROW));
_piv_row = atoi(mask2.get(FLD_BA6B_PIVROW));
_cod_row = atoi(mask2.get(FLD_BA6B_CODROW));
_rows_et = atoi(mask2.get(FLD_BA6B_TOTROW));
_ind_col = atoi(mask2.get(FLD_BA6B_INDCOL));
_piv_col = atoi(mask2.get(FLD_BA6B_PIVCOL));
_cod_col = atoi(mask2.get(FLD_BA6B_CODCOL));
_cols_et = atoi(mask2.get(FLD_BA6B_TOTCOL));
_ind_what = (in)atoi(mask2.get(RDB_BA6B_INDIR));
_ind_row = atoi(mask2.get(FLD_BA6B_INDROW));
_piv_row = atoi(mask2.get(FLD_BA6B_PIVROW));
_cod_row = atoi(mask2.get(FLD_BA6B_CODROW));
_rows_et = atoi(mask2.get(FLD_BA6B_TOTROW));
_ind_col = atoi(mask2.get(FLD_BA6B_INDCOL));
_piv_col = atoi(mask2.get(FLD_BA6B_PIVCOL));
_cod_col = atoi(mask2.get(FLD_BA6B_CODCOL));
_cols_et = atoi(mask2.get(FLD_BA6B_TOTCOL));
_is_piv = mask2.get(CHK_BA6B_PIVA) == "X";
_is_cod = mask2.get(CHK_BA6B_CODICE) == "X";
_is_piv = mask2.get(CHK_BA6B_PIVA) == "X";
_is_cod = mask2.get(CHK_BA6B_CODICE) == "X";
if (_frpos) delete _frpos;
_frpos = new bool[_rows_et];
memset(_frpos,FALSE,sizeof(_frpos));
_frpos[_ind_row-1] = TRUE;
_frpos[_ind_row] = TRUE;
if (_is_piv) _frpos[_piv_row-1] = TRUE;
if (_is_cod) _frpos[_cod_row-1] = TRUE;
if (_frpos) delete _frpos;
_frpos = new bool[_rows_et];
memset(_frpos,FALSE,sizeof(_frpos));
_frpos[_ind_row-1] = TRUE;
_frpos[_ind_row] = TRUE;
if (_is_piv) _frpos[_piv_row-1] = TRUE;
if (_is_cod) _frpos[_cod_row-1] = TRUE;
for (int jk = 0; jk < _rows_et; jk++)
if (!_frpos[jk]) set_row(jk+1,"");
for (int jk = 0; jk < _rows_et; jk++)
if (!_frpos[jk]) set_row(jk+1,"");
// save settings
if (mask2.get(CHK_BA6B_SAVE) == "X")
mask2.save();
}
break;
case BUT_BA6_RUBRICHE:
_ana_link = enable_link("Collegamento archivio anagrafiche: ", 'b');
_dit_link = enable_link("Collegamento archivio ditte: ", 'r');
_pr_type = rubriche;
break;
// save settings
if (mask2.get(CHK_BA6B_SAVE) == "X")
mask2.save();
}
break;
case BUT_BA6_RUBRICHE:
_ana_link = enable_link("Collegamento archivio anagrafiche: ", 'b');
_dit_link = enable_link("Collegamento archivio ditte: ", 'r');
_pr_type = rubriche;
break;
}
_pr_what = (pw)atoi(mask.get(RDB_BA6_TYPE));
_sort = atoi(mask.get(RDB_BA6_SORT));
_inclditte = (bool)(mask.get(CHK_BA6_INCLDI) == "X");
_inclditte = (bool)(mask.get(CHK_BA6_INCLDI) == "X");
TString cod_from(5), cod_to(5);
TLocalisamfile* fl;
switch(_pr_what)
switch(_pr_what)
{
case anafis:
case anagiu:
select_cursor(_pr_what == anafis ? cfis() : cgiu());
if (_sort == 1)
{
case anafis:
case anagiu:
select_cursor(_pr_what == anafis ? cfis() : cgiu());
if (_sort == 1)
{
cod_from = mask.get(_pr_what == anafis ? FLD_ANF_CODFR
: FLD_ANG_CODFR);
cod_to = mask.get(_pr_what == anafis ? FLD_ANF_CODTO
: FLD_ANG_CODTO);
}
else
{
cod_from = mask.get(_pr_what == anafis ? FLD_ANF_RAGSOCFR
: FLD_ANG_RAGSOCFR);
cod_to = mask.get(_pr_what == anafis ? FLD_ANF_RAGSOCTO
: FLD_ANG_RAGSOCTO);
}
{
fl = current_cursor()->file(LF_ANAG);
TRectype tr1(fl->curr());
TRectype tr2(fl->curr());
tr1.zero(); tr2.zero();
tr1.put("TIPOA", _pr_what == anafis ? "F" : "G");
tr2.put("TIPOA", _pr_what == anafis ? "F" : "G");
if (!cod_from.empty() || !cod_to.empty())
{
if (_sort == 1)
{
if (cod_from.not_empty())
{
tr1.put("CODANAGR",cod_from);
tr2.put("CODANAGR",cod_to);
}
}
else
{
if (cod_from.not_empty())
{
tr1.put("RAGSOC",cod_from);
tr2.put("RAGSOC",cod_to);
}
}
}
current_cursor()->setregion(&tr1, &tr2);
}
break;
case nditte:
select_cursor(cdit());
if (_sort == 1)
{
cod_from = mask.get(FLD_DITTE_CODFR);
cod_to = mask.get(FLD_DITTE_CODTO);
}
else
{
cod_from = mask.get(FLD_DITTE_RAGSOCFR);
cod_to = mask.get(FLD_DITTE_RAGSOCTO);
}
if (!cod_from.empty() || !cod_to.empty())
{
fl = current_cursor()->file(LF_NDITTE);
TRectype tr1(fl->curr());
TRectype tr2(fl->curr());
tr1.zero(); tr2.zero();
if (_sort == 1)
{
tr1.put("CODDITTA",cod_from);
tr2.put("CODDITTA",cod_to);
}
else
{
tr1.put("RAGSOC",cod_from);
tr2.put("RAGSOC",cod_to);
}
current_cursor()->setregion(cod_from.empty() ? NULL : &tr1,
cod_to.empty() ? NULL : &tr2);
}
break;
cod_from = mask.get(_pr_what == anafis ? FLD_ANF_CODFR
: FLD_ANG_CODFR);
cod_to = mask.get(_pr_what == anafis ? FLD_ANF_CODTO
: FLD_ANG_CODTO);
}
else
{
cod_from = mask.get(_pr_what == anafis ? FLD_ANF_RAGSOCFR
: FLD_ANG_RAGSOCFR);
cod_to = mask.get(_pr_what == anafis ? FLD_ANF_RAGSOCTO
: FLD_ANG_RAGSOCTO);
}
{
fl = current_cursor()->file(LF_ANAG);
TRectype tr1(fl->curr());
TRectype tr2(fl->curr());
tr1.zero(); tr2.zero();
tr1.put("TIPOA", _pr_what == anafis ? "F" : "G");
tr2.put("TIPOA", _pr_what == anafis ? "F" : "G");
if (!cod_from.empty() || !cod_to.empty())
{
if (_sort == 1)
{
if (cod_from.not_empty())
{
tr1.put("CODANAGR",cod_from);
tr2.put("CODANAGR",cod_to);
}
}
else
{
if (cod_from.not_empty())
{
tr1.put("RAGSOC",cod_from);
tr2.put("RAGSOC",cod_to);
}
}
}
current_cursor()->setregion(tr1, tr2);
}
break;
case nditte:
select_cursor(cdit());
if (_sort == 1)
{
cod_from = mask.get(FLD_DITTE_CODFR);
cod_to = mask.get(FLD_DITTE_CODTO);
}
else
{
cod_from = mask.get(FLD_DITTE_RAGSOCFR);
cod_to = mask.get(FLD_DITTE_RAGSOCTO);
}
if (!cod_from.empty() || !cod_to.empty())
{
fl = current_cursor()->file(LF_NDITTE);
TRectype tr1(fl->curr());
TRectype tr2(fl->curr());
tr1.zero(); tr2.zero();
if (_sort == 1)
{
tr1.put("CODDITTA",cod_from);
tr2.put("CODDITTA",cod_to);
}
else
{
tr1.put("RAGSOC",cod_from);
tr2.put("RAGSOC",cod_to);
}
current_cursor()->setregion(tr1, tr2);
}
break;
}
// setup links and set headers
init_print();
// enable_print_menu();
// enable_print_menu();
return TRUE;
return TRUE;
}
void BA6100_App::user_create()
{
TToken_string rxp(40);
{
TProgind p(5, "Preparazione archivi\nPrego attendere", FALSE, TRUE, 30);
{
TProgind p(5, "Preparazione archivi\nPrego attendere", FALSE, TRUE, 30);
// setup relation
_rel_fis = new TRelation(LF_ANAG);
_rel_giu = new TRelation(LF_ANAG);
_rel_dit = new TRelation(LF_NDITTE);
// setup relation
_rel_fis = new TRelation(LF_ANAG);
_rel_giu = new TRelation(LF_ANAG);
_rel_dit = new TRelation(LF_NDITTE);
p.addstatus(1);
p.addstatus(1);
rxp.add("CODANAGR=CODANAGR");
rxp.add("CODANAGR=CODANAGR");
_rel_fis->add(LF_ANAGFIS,rxp);
_rel_giu->add(LF_ANAGGIU,rxp);
_rel_fis->add(LF_ANAGFIS,rxp);
_rel_giu->add(LF_ANAGGIU,rxp);
rxp.add("TIPOA=TIPOA");
rxp.add("TIPOA=TIPOA");
_rel_fis->add(LF_NDITTE, rxp, 4);
_rel_giu->add(LF_NDITTE, rxp, 4);
_rel_dit->add(LF_ANAG, rxp);
_rel_fis->add(LF_NDITTE, rxp, 4);
_rel_giu->add(LF_NDITTE, rxp, 4);
_rel_dit->add(LF_ANAG, rxp);
p.addstatus(1);
p.addstatus(1);
// add unloc & attiv
rxp = "CODDITTA=CODDITTA";
// add unloc & attiv
rxp = "CODDITTA=CODDITTA";
_rel_fis->add(LF_ATTIV, rxp, 1, LF_NDITTE);
_rel_fis->add(LF_UNLOC, rxp, 1, LF_NDITTE);
_rel_giu->add(LF_ATTIV, rxp, 1, LF_NDITTE);
_rel_giu->add(LF_UNLOC, rxp, 1, LF_NDITTE);
_rel_dit->add(LF_ATTIV, rxp, 1);
_rel_dit->add(LF_UNLOC, rxp, 1);
_rel_fis->add(LF_SOCI, rxp, 1, LF_NDITTE);
_rel_giu->add(LF_SOCI, rxp, 1, LF_NDITTE);
_rel_dit->add(LF_SOCI, rxp, 1);
_rel_fis->add(LF_ATTIV, rxp, 1, LF_NDITTE);
_rel_fis->add(LF_UNLOC, rxp, 1, LF_NDITTE);
_rel_giu->add(LF_ATTIV, rxp, 1, LF_NDITTE);
_rel_giu->add(LF_UNLOC, rxp, 1, LF_NDITTE);
_rel_dit->add(LF_ATTIV, rxp, 1);
_rel_dit->add(LF_UNLOC, rxp, 1);
_rel_fis->add(LF_SOCI, rxp, 1, LF_NDITTE);
_rel_giu->add(LF_SOCI, rxp, 1, LF_NDITTE);
_rel_dit->add(LF_SOCI, rxp, 1);
p.addstatus(1);
p.addstatus(1);
_cfis1 = add_cursor(new TCursor(_rel_fis, "" , 1));
_cgiu1 = add_cursor(new TCursor(_rel_giu, "" , 1));
_cdit1 = add_cursor(new TCursor(_rel_dit, "", 1));
_cfis2 = add_cursor(new TCursor(_rel_fis, "" , 2));
_cgiu2 = add_cursor(new TCursor(_rel_giu, "" , 2));
_cdit2 = add_cursor(new TCursor(_rel_dit, "", 2));
_cfis1 = add_cursor(new TCursor(_rel_fis, "" , 1));
_cgiu1 = add_cursor(new TCursor(_rel_giu, "" , 1));
_cdit1 = add_cursor(new TCursor(_rel_dit, "", 1));
_cfis2 = add_cursor(new TCursor(_rel_fis, "" , 2));
_cgiu2 = add_cursor(new TCursor(_rel_giu, "" , 2));
_cdit2 = add_cursor(new TCursor(_rel_dit, "", 2));
p.addstatus(1);
p.addstatus(1);
_comuni = new TLocalisamfile(LF_COMUNI);
_comuni = new TLocalisamfile(LF_COMUNI);
// set translated field values
set_translation(LF_ANAGFIS,"STATCIV","1","Celibe/Nubile");
set_translation(LF_ANAGFIS,"STATCIV","2","Coniugato/a");
set_translation(LF_ANAGFIS,"STATCIV","3","Vedovo/a");
set_translation(LF_ANAGFIS,"STATCIV","4","Separato/a");
set_translation(LF_ANAGFIS,"STATCIV","5","Divorziato/a");
set_translation(LF_ANAGFIS,"STATCIV","6","Deceduto/a");
set_translation(LF_ANAGFIS,"STATCIV","7","Tutelato/a");
set_translation(LF_ANAGFIS,"STATCIV","8","Figlio/a minore");
set_translation(LF_ANAGFIS,"TITSTU", "1" ,"Nessuno");
set_translation(LF_ANAGFIS,"TITSTU", "2" ,"Lic. Elem.");
set_translation(LF_ANAGFIS,"TITSTU", "3" ,"Lic. Media");
set_translation(LF_ANAGFIS,"TITSTU", "4" ,"Diploma");
set_translation(LF_ANAGFIS,"TITSTU", "5" ,"Laurea");
set_translation(LF_ANAGFIS,"SESSO", "M", "Maschio");
set_translation(LF_ANAGFIS,"SESSO", "F", "Femmina");
set_translation(LF_NDITTE,"FREQVIVA","M","Mensile");
set_translation(LF_NDITTE,"FREQVIVA","T","Trimestrale");
set_translation(LF_NDITTE,"DATLAV","1","Si");
set_translation(LF_NDITTE,"DATLAV","2","No");
set_translation(LF_NDITTE,"DATLAV","3","Lavoro Agricolo");
set_translation(LF_NDITTE,"STATOSOC","1","Normale attivita'");
set_translation(LF_NDITTE,"STATOSOC","2","Liquidazione cessata attivita'");
set_translation(LF_NDITTE,"STATOSOC","3",
"Fallimento o Liquidazione coatta amm.");
set_translation(LF_NDITTE,"STATOSOC","4","Estinto");
set_translation(LF_ANAGGIU,"STATOSOC","1","Normale attivita'");
set_translation(LF_ANAGGIU,"STATOSOC","2","Liquidazione cessata attivita'");
set_translation(LF_ANAGGIU,"STATOSOC","3",
"Fallimento o Liquidazione coatta amm.");
set_translation(LF_ANAGGIU,"STATOSOC","4","Estinto");
set_translation(LF_ANAGGIU,"SITSOC","1","Inizio");
set_translation(LF_ANAGGIU,"SITSOC","2","Liquidazione");
set_translation(LF_ANAGGIU,"SITSOC","3","Termine liquidazione");
set_translation(LF_ANAGGIU,"SITSOC","4","Estinzione");
set_translation(LF_ANAGGIU,"SITSOC","5","Trasf. IRPEG");
set_translation(LF_ANAGGIU,"SITSOC","6","Normale");
// set translated field values
set_translation(LF_ANAGFIS,"STATCIV","1","Celibe/Nubile");
set_translation(LF_ANAGFIS,"STATCIV","2","Coniugato/a");
set_translation(LF_ANAGFIS,"STATCIV","3","Vedovo/a");
set_translation(LF_ANAGFIS,"STATCIV","4","Separato/a");
set_translation(LF_ANAGFIS,"STATCIV","5","Divorziato/a");
set_translation(LF_ANAGFIS,"STATCIV","6","Deceduto/a");
set_translation(LF_ANAGFIS,"STATCIV","7","Tutelato/a");
set_translation(LF_ANAGFIS,"STATCIV","8","Figlio/a minore");
set_translation(LF_ANAGFIS,"TITSTU", "1" ,"Nessuno");
set_translation(LF_ANAGFIS,"TITSTU", "2" ,"Lic. Elem.");
set_translation(LF_ANAGFIS,"TITSTU", "3" ,"Lic. Media");
set_translation(LF_ANAGFIS,"TITSTU", "4" ,"Diploma");
set_translation(LF_ANAGFIS,"TITSTU", "5" ,"Laurea");
set_translation(LF_ANAGFIS,"SESSO", "M", "Maschio");
set_translation(LF_ANAGFIS,"SESSO", "F", "Femmina");
set_translation(LF_NDITTE,"FREQVIVA","M","Mensile");
set_translation(LF_NDITTE,"FREQVIVA","T","Trimestrale");
set_translation(LF_NDITTE,"DATLAV","1","Si");
set_translation(LF_NDITTE,"DATLAV","2","No");
set_translation(LF_NDITTE,"DATLAV","3","Lavoro Agricolo");
set_translation(LF_NDITTE,"STATOSOC","1","Normale attivita'");
set_translation(LF_NDITTE,"STATOSOC","2","Liquidazione cessata attivita'");
set_translation(LF_NDITTE,"STATOSOC","3",
"Fallimento o Liquidazione coatta amm.");
set_translation(LF_NDITTE,"STATOSOC","4","Estinto");
set_translation(LF_ANAGGIU,"STATOSOC","1","Normale attivita'");
set_translation(LF_ANAGGIU,"STATOSOC","2","Liquidazione cessata attivita'");
set_translation(LF_ANAGGIU,"STATOSOC","3",
"Fallimento o Liquidazione coatta amm.");
set_translation(LF_ANAGGIU,"STATOSOC","4","Estinto");
set_translation(LF_ANAGGIU,"SITSOC","1","Inizio");
set_translation(LF_ANAGGIU,"SITSOC","2","Liquidazione");
set_translation(LF_ANAGGIU,"SITSOC","3","Termine liquidazione");
set_translation(LF_ANAGGIU,"SITSOC","4","Estinzione");
set_translation(LF_ANAGGIU,"SITSOC","5","Trasf. IRPEG");
set_translation(LF_ANAGGIU,"SITSOC","6","Normale");
set_fillchar('_');
set_wait_threshold(0);
set_fillchar('_');
set_wait_threshold(0);
p.addstatus(1);
}
p.addstatus(1);
}
}
void BA6100_App::user_destroy()

View File

@ -183,7 +183,7 @@ bool BA6200_application::set_print(int)
a.put(COM_STATO,statofine);
a.put(COM_COM ,codicefine);
current_cursor()->setregion(&da, &a);
current_cursor()->setregion(da, a);
}
else
if (scelta == 2)
@ -207,7 +207,7 @@ bool BA6200_application::set_print(int)
a.put (COM_DENCOM, denomfine);
current_cursor()->setregion(&da, &a);
current_cursor()->setregion(da, a);
}
//set_print_zero();

View File

@ -288,14 +288,13 @@ HIDDEN bool sottoc_handler(TMask_field& f, KEY key)
{
if (key == K_TAB)
{
TString gruppo(f.mask().get(FLD_CM1_GRUPPO));
if (gruppo.empty()) return TRUE;
TString conto(f.mask().get(FLD_CM1_CONTO));
TString sottoconto(f.mask().get(FLD_CM1_SOTTOCONTO));
if (sottoconto.not_empty() && conto.empty()) return f.error_box("Manca il CONTO");
dispatch_e_char(f.parent(), K_AUTO_ENTER);
int gruppo = f.mask().get_int(FLD_CM1_GRUPPO);
if (gruppo == 0) return TRUE;
int conto = f.mask().get_int(FLD_CM1_CONTO);
long sottoconto = f.mask().get_long(FLD_CM1_SOTTOCONTO);
if (sottoconto != 0 && conto == 0) return f.error_box("Manca il CONTO");
f.mask().stop_run(K_AUTO_ENTER);
}
return TRUE;
}

View File

@ -50,7 +50,7 @@ HIDDEN bool key_handler (TMask_field& f, KEY k)
if (m.get(F_ANNO).not_empty() && m.get(F_CODATT).not_empty() &&
m.get(F_CODCF).not_empty())
m.send_key(K_AUTO_ENTER, 0);
m.stop_run(K_AUTO_ENTER);
}
return TRUE;
}

View File

@ -2813,9 +2813,9 @@ bool CG1500_application::set_print(int)
_cur->setkey(3);
if (_situazione.not_empty())
_cur->filter(format("TIPOCF = \"%s\"",(const char*)_situazione));
_cur->setfilter(format("TIPOCF = \"%s\"",(const char*)_situazione));
else
_cur->filter("");
_cur->setfilter("");
_prog = new TProgind(_cur->items(),"Elaborazione in corso... prego attendere",FALSE);

File diff suppressed because it is too large Load Diff

View File

@ -996,7 +996,7 @@ bool CG3200_application::set_print(int)
a.put(PCN_CONTO,contofine);
a.put(PCN_SOTTOCONTO,sottocontofine);
current_cursor()->setregion(&da, &a);
current_cursor()->setregion(da, a);
}
else
{
@ -1026,7 +1026,7 @@ bool CG3200_application::set_print(int)
a.put(CLI_CONTO,contofine);
a.put(CLI_CODCF,sottocontofine);
current_cursor()->setregion(&da, &a);
current_cursor()->setregion(da, a);
}
if (_stampatotiva)
@ -1280,6 +1280,81 @@ void CG3200_application::calcola_progressivi_al()
void CG3200_application::calcola_progressivi()
{
<<<<<<< cg3200.cpp
TLocalisamfile pconti(LF_PCON);
TLocalisamfile saldi (LF_SALDI);
real pdaresca,paveresca,pdarescap,paverescap;
real progdare_attuale,progavere_attuale,progdare_prec,progavere_prec;
real saldo,progredare_eseprec,progreavere_eseprec,pdarep,paverep;
int indbil;
char salini;
TRectype record(saldi.curr());
saldo = 0.00;
pdarep = 0.00;
paverep = 0.00;
pdaresca = 0.00;
paveresca = 0.00;
pdarescap = 0.00;
paverescap = 0.00;
// Ricerca sull'archivio saldi dei record con gruppo,conto,sottoconto
// uguali a quelli di rmov per il calcolo dei progressivi precedenti
record.zero();
record.put(SLD_GRUPPO, _gruppo);
record.put(SLD_CONTO, _conto);
record.put(SLD_SOTTOCONTO, _sottoc);
if (_ricerca == 'P')
indbil = atoi (current_cursor()->file(LF_PCON)->get(PCN_INDBIL));
else
{
if ((_ricerca == 'C') || (_ricerca == 'F'))
{
pconti.setkey(1);
pconti.zero();
pconti.put(PCN_GRUPPO, _gruppo);
pconti.put(PCN_CONTO , _conto);
pconti.read();
if (pconti.good())
indbil = atoi (pconti.get(PCN_INDBIL));
else
indbil = 0;
}
}
saldi.setkey(2);
saldi.zero();
saldi.put(SLD_GRUPPO, _gruppo);
saldi.put(SLD_CONTO, _conto);
saldi.put(SLD_SOTTOCONTO, _sottoc);
for ( saldi.read();
((saldi.curr()==record) && !saldi.eof());
saldi.next())
{
long annoes_saldi = saldi.curr().get_long(SLD_ANNOES);
//Calcola i progressivi dell'esercizio attuale
if (annoes_saldi == _annomsk)
{
pdaresca = saldi.curr().get_real(SLD_PDARESCA);
paveresca = saldi.curr().get_real(SLD_PAVERESCA);
saldo = saldi.curr().get_real(SLD_SALDO);
salini = saldi.curr().get(SLD_FLAGSALINI)[0];
}
//Calcola i progressivi dell'esercizio precedente
if (annoes_saldi == _annoesmsk)
{
pdarescap = saldi.curr().get_real(SLD_PDARESCA);
pdarep = saldi.curr().get_real(SLD_PDARE);
paverescap = saldi.curr().get_real(SLD_PAVERESCA);
paverep = saldi.curr().get_real(SLD_PAVERE);
=======
TLocalisamfile pconti(LF_PCON);
TLocalisamfile saldi (LF_SALDI);
real pdaresca,paveresca,pdarescap,paverescap;
@ -1353,6 +1428,7 @@ void CG3200_application::calcola_progressivi()
pdarep = saldi.curr().get_real(SLD_PDARE);
paverescap = saldi.curr().get_real(SLD_PAVERESCA);
paverep = saldi.curr().get_real(SLD_PAVERE);
>>>>>>> 1.2
// Se il saldo dell'esercizio attuale e' diverso da 0 allora significa che
// quello corrisponde al saldo finale dell'esercizio precedente. Per ottenere

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
void CG4300_App::user_create()
{
TProgind pnd(3,"Preparazione archivi\nPrego attendere",
FALSE, TRUE, 30);
FALSE, TRUE, 30);
_nditte = new TRelation(LF_NDITTE);
_nditte->add(LF_ATTIV,"CODDITTA=CODDITTA");
@ -18,25 +18,25 @@ void CG4300_App::user_create()
_att_r = &(_nditte->curr(LF_ATTIV));
_ditte = new TArray_sheet(-1, -1, 0, 0, "Selezione Ditte",
"@1|Cod.@5|Ragione Sociale@50|Vers.");
"@1|Cod.@5|Ragione Sociale@50|Vers.");
_n_ditte = 0l;
pnd.addstatus(1);
for (_nditte->first(); !_nditte->eof(); _nditte->next())
{
TString cod = _nditte_r->get("CODDITTA");
TString vers = _nditte_r->get("FREQVIVA");
_n_ditte++;
{
TString cod = _nditte_r->get("CODDITTA");
TString vers = _nditte_r->get("FREQVIVA");
_n_ditte++;
TToken_string* d = new TToken_string(" ");
TToken_string* d = new TToken_string(" ");
// add record
d->add(cod);
d->add(_nditte_r->get("RAGSOC"));
d->add(vers);
_nomiditte.add(d);
}
// add record
d->add(cod);
d->add(_nditte_r->get("RAGSOC"));
d->add(vers);
_nomiditte.add(d);
}
pnd.addstatus(1);
@ -155,51 +155,51 @@ bool CG4300_App::set_print(int n)
_descr_arr.destroy();
switch(n)
{
case 1: // liquidazione
_isprint = TRUE;
if (set_liquidazione())
{
case 1: // liquidazione
_isprint = TRUE;
if (set_liquidazione())
{
if (_selected.ones() > 0l)
{
if (_year != yy)
{
TString cond(format("ANNOES=%s",(const char*)_year));
_cur->filter(cond);
}
recalc_all();
return _isprint;
}
else warning_box("Nessuna ditta selezionata!");
}
break;
case 2: // estrazione deleghe
_isprint = FALSE;
if (set_deleghe())
{
if (_year != yy)
{
TString cond(format("ANNOES=%s",(const char*)_year));
_cur->filter(cond);
}
extract_deleghe();
return FALSE;
}
break;
case 3: // calcolo acconto
_isprint = TRUE;
if (set_acconto())
{
if (_year != yy)
{
TString cond(format("ANNOES=%s",(const char*)_year));
_cur->filter(cond);
}
recalc_acconti();
return _isprint;
}
break;
if (_selected.ones() > 0l)
{
if (_year != yy)
{
TString cond(format("ANNOES=%s",(const char*)_year));
_cur->setfilter(cond);
}
recalc_all();
return _isprint;
}
else warning_box("Nessuna ditta selezionata!");
}
break;
case 2: // estrazione deleghe
_isprint = FALSE;
if (set_deleghe())
{
if (_year != yy)
{
TString cond(format("ANNOES=%s",(const char*)_year));
_cur->setfilter(cond);
}
extract_deleghe();
return FALSE;
}
break;
case 3: // calcolo acconto
_isprint = TRUE;
if (set_acconto())
{
if (_year != yy)
{
TString cond(format("ANNOES=%s",(const char*)_year));
_cur->setfilter(cond);
}
recalc_acconti();
return _isprint;
}
break;
}
return FALSE;
}
@ -225,11 +225,11 @@ bool CG4300_App::set_liquidazione()
_month = atoi(m.get(CG43_LST_MESE));
if (_what == all)
{
if (_month != 3 && _month != 6 && _month != 9 &&
_month != 12 && _month != 13)
_what = mnt;
}
{
if (_month != 3 && _month != 6 && _month != 9 &&
_month != 12 && _month != 13)
_what = mnt;
}
else if (_what == quarter)
_month = atoi(m.get(CG43_LST_TRIM));
@ -253,66 +253,66 @@ bool CG4300_App::set_liquidazione()
long j, cnt, chk; int i;
switch(k)
{
case DLG_SELECT:
// build sheet
_ditte->destroy(); chk = 0l;
for (i = 0; i < _nomiditte.items(); i++)
{
case DLG_SELECT:
// build sheet
_ditte->destroy(); chk = 0l;
for (i = 0; i < _nomiditte.items(); i++)
{
if (_selected[i]) continue;
TToken_string d = (const char*)((TToken_string&)_nomiditte[i]);
TString cod = d.get(0);
TString vers = d.get(2);
if ((_what == mnt && vers == "T") ||
(_what == quarter && vers == "M"))
continue;
if (_selected[i]) continue;
TToken_string d = (const char*)((TToken_string&)_nomiditte[i]);
TString cod = d.get(0);
TString vers = d.get(2);
if ((_what == mnt && vers == "T") ||
(_what == quarter && vers == "M"))
continue;
_ditte->add(d);
_ditte->add(d);
// check
if (!from.empty() || !to.empty())
{
if (from.empty()) from = "0";
if (to.empty()) to = "999999999";
if (atol(cod) >= atol(from) && atol(cod) <= atol(to))
_ditte->check(chk++);
}
}
// seleziona e aggiungi alle gia' selezionate
if (_ditte->run() == K_ENTER)
{
cnt = 0;
for (j = 0l; j < _n_ditte; j++)
{
if (_selected[j]) continue;
if (_ditte->checked(cnt++))
selected.set(j);
}
_selected |= selected;
selected.reset();
}
m.field(CG43_FLD_SELECTED).set(format("%ld",(long)_selected.ones()));
break;
case CG43_BUT_ANN:
_selected.reset();
m.field(CG43_FLD_SELECTED).set("0");
break;
case CG43_BUT_CHK:
{
_ditte->destroy();
for (i = 0; i < _nomiditte.items(); i++)
{
TToken_string d = (const char*)((TToken_string&)_nomiditte[i]);
_ditte->add(d);
if (_selected[i]) _ditte->check(i);
}
_ditte->disable_check();
_ditte->run();
_ditte->enable_check();
}
break;
// check
if (!from.empty() || !to.empty())
{
if (from.empty()) from = "0";
if (to.empty()) to = "999999999";
if (atol(cod) >= atol(from) && atol(cod) <= atol(to))
_ditte->check(chk++);
}
}
// seleziona e aggiungi alle gia' selezionate
if (_ditte->run() == K_ENTER)
{
cnt = 0;
for (j = 0l; j < _n_ditte; j++)
{
if (_selected[j]) continue;
if (_ditte->checked(cnt++))
selected.set(j);
}
_selected |= selected;
selected.reset();
}
m.field(CG43_FLD_SELECTED).set(format("%ld",(long)_selected.ones()));
break;
case CG43_BUT_ANN:
_selected.reset();
m.field(CG43_FLD_SELECTED).set("0");
break;
case CG43_BUT_CHK:
{
_ditte->destroy();
for (i = 0; i < _nomiditte.items(); i++)
{
TToken_string d = (const char*)((TToken_string&)_nomiditte[i]);
_ditte->add(d);
if (_selected[i]) _ditte->check(i);
}
_ditte->disable_check();
_ditte->run();
_ditte->enable_check();
}
break;
}
}
while (k != K_ENTER && k != K_ESC);

View File

@ -1,4 +1,4 @@
// $Id: maskfld.cpp,v 1.4 1994-08-26 13:07:14 guy Exp $
// $Id: maskfld.cpp,v 1.5 1994-08-26 14:05:29 alex Exp $
#include <xvt.h>
#include <applicat.h>
@ -1160,7 +1160,8 @@ int TBrowse::do_input(bool filter)
else work << _filter[i];
}
const char* w = work.empty() ? NULL : (const char*) work;
_cursor->setfilter(work);
_cursor->setregion(filtrec, filtrec);
if (filtrec.empty()) _cursor->filter(w);
else _cursor->filter(w, &filtrec, &filtrec);

View File

@ -718,7 +718,7 @@ bool TSpreadsheet::on_key(KEY k)
{
switch(k)
{
case K_SHIFT_ENTER:
case K_CTRL_ENTER:
case K_ESC:
mask().send_key(k, 0);
return TRUE;

View File

@ -1,4 +1,4 @@
// $Id: relapp.cpp,v 1.3 1994-08-23 13:52:26 guy Exp $
// $Id: relapp.cpp,v 1.4 1994-08-26 14:05:47 alex Exp $
#include <mailbox.h>
#include <sheet.h>
#include <urldefid.h>
@ -829,7 +829,8 @@ bool TRelation_application::filter()
if (campo != NULL)
campo->write(t.mid(u+1), rec);
}
cur->filter("", &rec, &rec);
cur->setfilter("");
cur->setregion(rec, rec);
if (s == NULL) id = 0;
}
}

View File

@ -1,4 +1,4 @@
// $Id: relation.cpp,v 1.4 1994-08-24 07:24:04 villa Exp $
// $Id: relation.cpp,v 1.5 1994-08-26 14:06:00 alex Exp $
// relation.cpp
// fv 12/8/93
// relation class for isam files
@ -845,7 +845,8 @@ TRecnotype TCursor::update()
}
void TCursor::filter(const char* filter, TRectype *from, TRectype* to)
void TCursor::filter(const char* filter, const TRectype *from,
const TRectype* to)
{
CHECK(!_frozen, "Impossibile filtrare un cursore congelato");

View File

@ -1,4 +1,4 @@
/* $Id: relation.h,v 1.1.1.1 1994-08-12 10:52:02 alex Exp $ */
/* $Id: relation.h,v 1.2 1994-08-26 14:06:07 alex Exp $ */
// join.h
// fv 12/8/93
// join class for isam files
@ -19,124 +19,124 @@
class TRelation : public TObject
{
friend class TRelationdef;
friend class TRelationdef;
// class TRelation : public TLocalisamfile
// @END
// class TRelation : public TLocalisamfile
// @END
// @DPRIV
TToken_string _status; // stato della relazione
TArray _files; // file descriptors
TArray _reldefs; // TRelationdef array
int _errors;
// @END
// @DPRIV
TToken_string _status; // stato della relazione
TArray _files; // file descriptors
TArray _reldefs; // TRelationdef array
int _errors;
// @END
// @FPROT
// @FPROT
protected:
virtual void print_on(ostream& out) const;
virtual void print_on(ostream& out) const;
int log2ind(int logicnum) const;
int alias2ind(byte alias) const;
int name2ind(const char* name) const;
int log2ind(int logicnum) const;
int alias2ind(byte alias) const;
int name2ind(const char* name) const;
TRelationdef* reldef(int i) const { return (TRelationdef*)&_reldefs[i]; }
TLocalisamfile* file(int i = 0) const { return (TLocalisamfile*)&_files[i]; }
TRelationdef* reldef(int i) const { return (TRelationdef*)&_reldefs[i]; }
TLocalisamfile* file(int i = 0) const { return (TLocalisamfile*)&_files[i]; }
// @LONGDES
// position_rels fa tutto il lavoro: se non trova un record
// adatto su un file, svuota il record corrente e non ritorna errore.
// write etc. poi procedono normalmente
// @END
int position_rels(TIsamop op = _isequal, TReclock lockop = _nolock, TDate& atdate = botime, int first = 0);
// @LONGDES
// position_rels fa tutto il lavoro: se non trova un record
// adatto su un file, svuota il record corrente e non ritorna errore.
// write etc. poi procedono normalmente
// @END
int position_rels(TIsamop op = _isequal, TReclock lockop = _nolock, TDate& atdate = botime, int first = 0);
friend class TCursor;
friend class TCursor;
public:
// @FPUB
int update() { return position_rels(_isequal, _nolock);}
void zero();
virtual int next(TReclock lockop = _nolock) { return file()->next(lockop) == NOERR ? position_rels(_isequal, lockop) : file()->status(); }
virtual int prev(TReclock lockop = _nolock) { return file()->prev(lockop) == NOERR ? position_rels(_isequal, lockop) : file()->status(); }
virtual int next(TDate& atdate) { return file()->next(atdate) == NOERR ? position_rels(_isequal, _nolock, atdate) : file()->status(); }
virtual int prev(TDate& atdate) { return file()->prev(atdate) == NOERR ? position_rels(_isequal, _nolock, atdate) : file()->status(); }
virtual int first(TReclock lockop = _nolock) { return file()->first(lockop) == NOERR ? position_rels(_isequal, lockop) : file()->status(); }
virtual int last(TReclock lockop = _nolock) { return file()->last(lockop) == NOERR ? position_rels(_isequal, lockop) : file()->status(); }
virtual int skip(TRecnotype nrec, TReclock lockop = _nolock) { return file()->skip(nrec, lockop) == NOERR ? position_rels(_isequal, lockop) : file()->status(); }
virtual int read(TIsamop op = _isgteq, TReclock lockop = _nolock, TDate& atdate = botime) { return file()->read(op, lockop, atdate) == NOERR ? position_rels(_isequal, lockop, atdate) : file()->status();}
public:
// @FPUB
int update() { return position_rels(_isequal, _nolock);}
void zero();
virtual int next(TReclock lockop = _nolock) { return file()->next(lockop) == NOERR ? position_rels(_isequal, lockop) : file()->status(); }
virtual int prev(TReclock lockop = _nolock) { return file()->prev(lockop) == NOERR ? position_rels(_isequal, lockop) : file()->status(); }
virtual int next(TDate& atdate) { return file()->next(atdate) == NOERR ? position_rels(_isequal, _nolock, atdate) : file()->status(); }
virtual int prev(TDate& atdate) { return file()->prev(atdate) == NOERR ? position_rels(_isequal, _nolock, atdate) : file()->status(); }
virtual int first(TReclock lockop = _nolock) { return file()->first(lockop) == NOERR ? position_rels(_isequal, lockop) : file()->status(); }
virtual int last(TReclock lockop = _nolock) { return file()->last(lockop) == NOERR ? position_rels(_isequal, lockop) : file()->status(); }
virtual int skip(TRecnotype nrec, TReclock lockop = _nolock) { return file()->skip(nrec, lockop) == NOERR ? position_rels(_isequal, lockop) : file()->status(); }
virtual int read(TIsamop op = _isgteq, TReclock lockop = _nolock, TDate& atdate = botime) { return file()->read(op, lockop, atdate) == NOERR ? position_rels(_isequal, lockop, atdate) : file()->status();}
TLocalisamfile* lfile(int logicnum = 0) const;
TLocalisamfile* lfile(const char* name) const;
void write_enable(int logicnum = -1, const bool on = TRUE) ;
void write_enable(const char* name, const bool on = TRUE) ;
void write_disable(int logicnum = -1) { write_enable(logicnum, FALSE); }
void write_disable(const char* name) { write_enable(name, FALSE); }
TLocalisamfile* lfile(int logicnum = 0) const;
TLocalisamfile* lfile(const char* name) const;
void write_enable(int logicnum = -1, const bool on = TRUE) ;
void write_enable(const char* name, const bool on = TRUE) ;
void write_disable(int logicnum = -1) { write_enable(logicnum, FALSE); }
void write_disable(const char* name) { write_enable(name, FALSE); }
TRectype& curr(int logicnum = 0) const { return lfile(logicnum)->curr(); }
// next_match for 0ne-to-many relations; positions logicnum (!= main)
// on next matching record; returns TRUE or FALSE if no more matches; in
// any case relation is kept consistent except when inconsistent in
// first place
bool next_match(int logicnum, const char* fieldlist = NULL, int nkey = 0);
TRectype& curr(int logicnum = 0) const { return lfile(logicnum)->curr(); }
// next_match for 0ne-to-many relations; positions logicnum (!= main)
// on next matching record; returns TRUE or FALSE if no more matches; in
// any case relation is kept consistent except when inconsistent in
// first place
bool next_match(int logicnum, const char* fieldlist = NULL, int nkey = 0);
// @DES add relation
// @FPUB
bool add(int logicnum, const char* relexprs, int key = 1,
int linkto = 0, byte alias = 0, bool allow_lock = FALSE);
bool add(const char* tabname, const char* relexprs, int key = 1,
int linkto = 0, byte alias = 0, bool allow_lock = FALSE);
// @DES add relation
// @FPUB
bool add(int logicnum, const char* relexprs, int key = 1,
int linkto = 0, byte alias = 0, bool allow_lock = FALSE);
bool add(const char* tabname, const char* relexprs, int key = 1,
int linkto = 0, byte alias = 0, bool allow_lock = FALSE);
// @DES write methods
// @FPUB
virtual int write (bool force = TRUE, TDate& atdate = botime);
virtual int rewrite(bool force = TRUE, TDate& atdate = botime);
virtual int remove (TDate& atdate = botime);
// @DES write methods
// @FPUB
virtual int write (bool force = TRUE, TDate& atdate = botime);
virtual int rewrite(bool force = TRUE, TDate& atdate = botime);
virtual int remove (TDate& atdate = botime);
// @DES checking methods
// @FPUB
bool eof( int logicnum = 0) { return lfile(logicnum)->eof(); }
bool bof( int logicnum = 0) { return lfile(logicnum)->bof(); }
// @DES checking methods
// @FPUB
bool eof( int logicnum = 0) { return lfile(logicnum)->eof(); }
bool bof( int logicnum = 0) { return lfile(logicnum)->bof(); }
// @N
// status(), good() and bad() return the status of the relation when called
// with no args, or the status of the file when called with
// a logical number
// @END
// @N
// status(), good() and bad() return the status of the relation when called
// with no args, or the status of the file when called with
// a logical number
// @END
bool status(int logicnum = 0) { return lfile(logicnum)->status(); }
bool good( int logicnum = 0) { return lfile(logicnum)->good(); }
bool bad( int logicnum = 0) { return lfile(logicnum)->bad(); }
bool empty( int logicnum = 0) { return lfile(logicnum)->empty(); }
// @END
bool status(int logicnum = 0) { return lfile(logicnum)->status(); }
bool good( int logicnum = 0) { return lfile(logicnum)->good(); }
bool bad( int logicnum = 0) { return lfile(logicnum)->bad(); }
bool empty( int logicnum = 0) { return lfile(logicnum)->empty(); }
// @END
// @LONGDES
// isconsistent() returns TRUE if every file in the relation is
// OK, current record is non-empty, and relation is consistent.
// If it's not and reset is TRUE, it tries to reset the relation
// to a consistent state (based on main record) -- no further check
// is done.
// Also called internally by update and remove.
// @END
bool isconsistent(bool reset = FALSE);
// @LONGDES
// isconsistent() returns TRUE if every file in the relation is
// OK, current record is non-empty, and relation is consistent.
// If it's not and reset is TRUE, it tries to reset the relation
// to a consistent state (based on main record) -- no further check
// is done.
// Also called internally by update and remove.
// @END
bool isconsistent(bool reset = FALSE);
// TRUE se c'e' un record ed e' il primo match (non si e' mai fatta
// position_rels)
bool is_first_match(int logicnum);
// TRUE se c'e' un record ed e' il primo match (non si e' mai fatta
// position_rels)
bool is_first_match(int logicnum);
void save_status () ;
void restore_status () ;
void save_status () ;
void restore_status () ;
// @DES positioning operators. return status
// @FPUB
// @DES positioning operators. return status
// @FPUB
TRecnotype operator +=(const TRecnotype npos) { return skip(npos); }
TRecnotype operator -=(const TRecnotype npos) { return skip(-npos); }
TRecnotype operator ++() { return next(); }
TRecnotype operator --() { return prev(); }
TRecnotype operator +=(const TRecnotype npos) { return skip(npos); }
TRecnotype operator -=(const TRecnotype npos) { return skip(-npos); }
TRecnotype operator ++() { return next(); }
TRecnotype operator --() { return prev(); }
TRelation(int logicnum, bool linkrecinst = TRUE);
TRelation(const char* tabname, bool linkrecinst = TRUE);
virtual ~TRelation();
TRelation(int logicnum, bool linkrecinst = TRUE);
TRelation(const char* tabname, bool linkrecinst = TRUE);
virtual ~TRelation();
};
// @C
@ -150,81 +150,83 @@ typedef bool (*FILTERFUNCTION)(const TRelation* r);
class TCursor : public TObject
{
// @DPRIV
TRelation* _if;
int _nkey;
TRecnotype _pos; // Posizione corrente
TRecnotype _totrec;
TRecnotype _lastrec;
TRecnotype _lastkrec;
TFilename _filename;
TString _filter; // Filtro
TString _keyfrom; // chiave iniziale
TString _keyto; // chiave finale
TExpression* _fexpr; // Espressione relativo filtro
bool _frozen;
FILTERFUNCTION _filterfunction;
TFilename _indexname;
// @END
// @DPRIV
TRelation* _if;
int _nkey;
TRecnotype _pos; // Posizione corrente
TRecnotype _totrec;
TRecnotype _lastrec;
TRecnotype _lastkrec;
TFilename _filename;
TString _filter; // Filtro
TString _keyfrom; // chiave iniziale
TString _keyto; // chiave finale
TExpression* _fexpr; // Espressione relativo filtro
bool _frozen;
FILTERFUNCTION _filterfunction;
TFilename _indexname;
// @END
// @FPRIV
virtual TRecnotype buildcursor(TRecnotype rp);
int filtercursor(int pagecnt, TRecnotype* page);
bool changed();
// @FPRIV
virtual TRecnotype buildcursor(TRecnotype rp);
int filtercursor(int pagecnt, TRecnotype* page);
bool changed();
FILE* open_index(bool create = FALSE) const;
TRecnotype update();
FILE* open_index(bool create = FALSE) const;
TRecnotype update();
protected:
TRecnotype readrec();
protected:
TRecnotype readrec();
void filter(const char* filter, const TRectype* from = NULL,
const TRectype* to = NULL);
public:
// @FPUB
TRecnotype operator =(const TRecnotype nr); // Assegnazione
TCursor& operator +=(const TRecnotype nr); // Scorri avanti
TCursor& operator -=(const TRecnotype nr); // Scorri indietro
TCursor& operator ++(); // Avanti di un record
TCursor& operator --(); // Indietro di un record
TRecnotype pos() const { return _pos; }
TRecnotype items();
TRecnotype size() const { return file()->eod(); }
const TString& from() const { return _keyfrom; }
const TString& to() const { return _keyto; }
public:
// @FPUB
TRecnotype operator =(const TRecnotype nr); // Assegnazione
TCursor& operator +=(const TRecnotype nr); // Scorri avanti
TCursor& operator -=(const TRecnotype nr); // Scorri indietro
TCursor& operator ++(); // Avanti di un record
TCursor& operator --(); // Indietro di un record
TRecnotype pos() const { return _pos; }
TRecnotype items();
TRecnotype size() const { return file()->eod(); }
const TString& from() const { return _keyfrom; }
const TString& to() const { return _keyto; }
TRectype& curr(int log = 0) const { return _if->curr(log); }
TRectype& curr(const char * tab) const
{ return _if->lfile(tab)->curr(); }
TRecnotype read(TIsamop op = _isgteq, TReclock lockop = _nolock, TDate& atdate = botime);
virtual bool ok() const;
TRectype& curr(int log = 0) const { return _if->curr(log); }
TRectype& curr(const char * tab) const
{ return _if->lfile(tab)->curr(); }
TRecnotype read(TIsamop op = _isgteq, TReclock lockop = _nolock, TDate& atdate = botime);
virtual bool ok() const;
void filter(const char* filter, TRectype* from = NULL, TRectype* to = NULL);
const char* filter() const { return _filter; }
void freeze(bool on = TRUE) { _frozen = on; }
bool frozen() const { return _frozen; }
void setregion(TRectype* from = NULL, TRectype* to = NULL)
{ filter(NULL,from,to); }
const char* filter() const { return _filter; }
void freeze(bool on = TRUE) { _frozen = on; }
bool frozen() const { return _frozen; }
void setfilter(const char* filter_expr) { filter(filter_expr); }
void setregion(const TRectype& from, const TRectype& to)
{ filter(NULL,&from, &to); }
TRelation* relation() const { return _if; }
TLocalisamfile* file(int lnum = 0) const { return _if->lfile(lnum); }
TLocalisamfile* file(const char* name) const { return _if->lfile(name); }
int repos() { return _if->position_rels(); }
TRelation* relation() const { return _if; }
TLocalisamfile* file(int lnum = 0) const { return _if->lfile(lnum); }
TLocalisamfile* file(const char* name) const { return _if->lfile(name); }
int repos() { return _if->position_rels(); }
void setkey() { file()->setkey(_nkey); }
void setkey(int nkey);
int key() const { return _nkey; }
void setkey() { file()->setkey(_nkey); }
void setkey(int nkey);
int key() const { return _nkey; }
bool next_match(int lognum, const char* fl = NULL, int nk = 0);
bool is_first_match(int ln);
bool next_match(int lognum, const char* fl = NULL, int nk = 0);
bool is_first_match(int ln);
void set_filterfunction(FILTERFUNCTION ff) { _filterfunction = ff; _lastrec = 0L;}
bool has_filter() const { return _filter.not_empty() || _filterfunction; }
void set_filterfunction(FILTERFUNCTION ff) { _filterfunction = ff; _lastrec = 0L;}
bool has_filter() const { return _filter.not_empty() || _filterfunction; }
void save_status () { _if->save_status(); }
void restore_status () { _if->restore_status(); }
void save_status () { _if->save_status(); }
void restore_status () { _if->restore_status(); }
TCursor(TRelation* f, const char* filter = "", int key = 1, TRectype* from = NULL, TRectype* to = NULL);
virtual ~TCursor();
TCursor(TRelation* f, const char* filter = "", int key = 1, TRectype* from = NULL, TRectype* to = NULL);
virtual ~TCursor();
};
@ -234,33 +236,33 @@ class TCursor : public TObject
class TFieldref : public TObject
{
// @DPRIV
short _fileid; // Numero del file
TString16 _id; // Nome tabella o stringa col numero del file
TString16 _name; // Nome del campo
int _from, _to; // Substring
// @DPRIV
short _fileid; // Numero del file
TString16 _id; // Nome tabella o stringa col numero del file
TString16 _name; // Nome del campo
int _from, _to; // Substring
protected:
virtual void print_on(ostream& out) const;
virtual void print_on(ostream& out) const;
public:
// @FPUB
TFieldref();
TFieldref(const TString&, short defid);
// @FPUB
TFieldref();
TFieldref(const TString&, short defid);
TFieldref& operator =(const TString& s); // Operatore di assegnazione
TFieldref& operator =(const TString& s); // Operatore di assegnazione
virtual bool ok() const { return _name.not_empty(); } // Vero se il numero del file e' valido
virtual bool ok() const { return _name.not_empty(); } // Vero se il numero del file e' valido
int file() const { return _fileid; } // ritorna il file
const char* name() const { return (const char*) _name; } // ritorna il nome del campo
int from() const { return _from; }
int to() const { return _to; }
int len(TRectype &rec) const;
const char* read(const TRelation* = NULL) const;
const char* read(const TRectype&) const;
void write(const char* val, TRelation* = NULL) const;
void write(const char* val, TRectype& rec) const;
int file() const { return _fileid; } // ritorna il file
const char* name() const { return (const char*) _name; } // ritorna il nome del campo
int from() const { return _from; }
int to() const { return _to; }
int len(TRectype &rec) const;
const char* read(const TRelation* = NULL) const;
const char* read(const TRectype&) const;
void write(const char* val, TRelation* = NULL) const;
void write(const char* val, TRectype& rec) const;
};
// Converte una stringa in numero logico o numero tabella
int name2log(const char* name);