Aggiuornato uso di Relation::lfile e main_app

git-svn-id: svn://10.65.10.50/trunk@275 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1994-09-22 07:40:02 +00:00
parent b2079b8379
commit 5e9b747386
15 changed files with 5259 additions and 5232 deletions

View File

@ -19,7 +19,7 @@ class Riga_tabinl : public TToken_string
{
public:
const TString& operator = (const TString& s)
{return TToken_string::operator=(s);}
{return TToken_string::operator=(s);}
Riga_tabinl (long,int,long,long,long,const char*,long,long,const char*,bool,bool);
};
@ -47,10 +47,10 @@ void TRighe_tabinl::add_riga(long annorg,int meserg,long pilib,long pflib,long c
class TRighe_gia_presenti : public TBit_array
{
public:
bool IS_IN (long) const;
void togli (long);
TRighe_gia_presenti (long size) : TBit_array(size) {}
public:
bool IS_IN (long) const;
void togli (long);
TRighe_gia_presenti (long size) : TBit_array(size) {}
};
void TRighe_gia_presenti::togli(long numrig)
@ -92,11 +92,11 @@ protected:
virtual bool changing_mask(int mode) {return FALSE; }
virtual bool remove();
// void init_mask(TMask&);
// void init_mask(TMask&);
virtual void init_query_mode(TMask&);
// virtual void init_modify_mode(TMask&);
// virtual void init_modify_mode(TMask&);
// virtual void init_insert_mode(TMask&);
// virtual void init_insert_mode(TMask&);
virtual int rewrite(const TMask& m);
virtual int write(const TMask& m);
virtual int read(TMask& m);
@ -119,7 +119,7 @@ void BA3500_application::read_tabinl(TMask& m)
bool stampa_bol = FALSE;
bool pagine_ann = FALSE;
bool ok = FALSE;
// TTable* tab_inl = (TTable*)_rel->lfile(TAB_INL);
// TTable* tab_inl = (TTable*)_rel->lfile(TAB_INL);
TTable& tab_inl = (TTable&)_rel->lfile(-ALIAS);
long numrig;
int anno;
@ -133,7 +133,7 @@ void BA3500_application::read_tabinl(TMask& m)
_righe_gia_presenti = new TRighe_gia_presenti(tab_inl.items());
_righe_gia_presenti->reset();
// int lognum = name2log(TAB_INL); //trasformo il nome della tab in un logicnum
// int lognum = name2log(TAB_INL); //trasformo il nome della tab in un logicnum
ok = _rel->is_first_match(-ALIAS);
@ -190,8 +190,8 @@ bool BA3500_application::fill_sheet(TMask& m)
}
/********
void BA3500_application::init_insert_mode(TMask& m)
{
void BA3500_application::init_insert_mode(TMask& m)
{
_righe_tabinl.destroy();
@ -199,16 +199,16 @@ void BA3500_application::init_insert_mode(TMask& m)
cs.reset();
for (int j = 0; j < 16 ; j++)
TToken_string &riga = cs.row(j);
TToken_string &riga = cs.row(j);
cs.force_update();
}
**********/
}
**********/
void BA3500_application::init_query_mode(TMask& m)
{
_righe_tabinl.destroy();
_righe_tabinl.destroy();
TSheet_field& cs = (TSheet_field&)m.field(F_SHEET_LBU);
cs.reset();
@ -224,7 +224,7 @@ void BA3500_application::init_query_mode(TMask& m)
int BA3500_application::rewrite(const TMask& m)
{
long items;
// TTable *tab_inl = (TTable*)_rel->lfile(TAB_INL);
// TTable *tab_inl = (TTable*)_rel->lfile(TAB_INL);
TTable& tab_inl = (TTable&)_rel->lfile(-ALIAS);
int anno = m.get_int(F_ANNO);
@ -257,11 +257,11 @@ int BA3500_application::rewrite(const TMask& m)
tab_inl.put ("B1", riga.get());
if (_righe_gia_presenti->IS_IN(i))
{
tab_inl.rewrite();
_righe_gia_presenti->togli(i);
tab_inl.rewrite();
_righe_gia_presenti->togli(i);
}
else
tab_inl.write();
tab_inl.write();
}
}
return _rel->rewrite();
@ -270,7 +270,7 @@ int BA3500_application::rewrite(const TMask& m)
int BA3500_application::write(const TMask& m)
{
long items;
// TTable *tab_inl = (TTable*)_rel->lfile(TAB_INL);
// TTable *tab_inl = (TTable*)_rel->lfile(TAB_INL);
TTable& tab_inl = (TTable&)_rel->lfile(-ALIAS);
int anno = m.get_int(F_ANNO);
@ -339,29 +339,29 @@ int BA3500_application::cancella(long items)
dep << format ("%6d" , i);
tab_inl.put("CODTAB", dep);
if (tab_inl.read(_isequal, _lock) == NOERR)
tab_inl.remove();
tab_inl.remove();
}
return tab_inl.status();
}
/*********
void BA3500_application::init_modify_mode(TMask& m)
{
void BA3500_application::init_modify_mode(TMask& m)
{
init_mask(m);
}
}
void BA3500_application::init_mask(TMask& m)
{
void BA3500_application::init_mask(TMask& m)
{
TString tpd(m.get(F_TIPO_DOC));
TString tpm(m.get(F_TIPO_MOV));
if (tpd.trim().empty())
m.set(F_TIPO_MOV_2, tpm);
m.set(F_TIPO_MOV_2, tpm);
else
m.set(F_TIPO_MOV_1, tpm);
}
***********/
m.set(F_TIPO_MOV_1, tpm);
}
***********/
int BA3500_application::read(TMask& m)
{
m.autoload(_rel);

View File

@ -1,12 +1,12 @@
// posizione file comuni in _arrfiles
// campi maschera batb%ivd.msk
// campi maschera batb%ivd.msk
#define F_SEZ 101
#define F_LETT 102
#define F_CLASSE 103
#define F_NUM 104
#define F_DESCR 105
#define F_DESCR_LETT 106
#define F_DESCR_CLAS 107

View File

@ -11,7 +11,7 @@ PAGE "Tabella codici IV direttiva CEE" -1 -1 78 15
LIST F_SEZ 1 18
BEGIN
PROMPT 4 1 "Sezione "
PROMPT 1 1 "Sezione "
FIELD %IVD->CODTAB[1,1]
ITEM "1|Attivita'"
ITEM "2|Passivita'"
@ -22,14 +22,63 @@ END
STRING F_LETT 1
BEGIN
PROMPT 4 3 "Lettera "
PROMPT 1 3 "Lettera "
FIELD %IVD->CODTAB[2,2]
FLAGS "U"
KEY 1
USE %IVD
INPUT CODTAB[1,1] F_SEZ
INPUT CODTAB[2,2] F_LETT
DISPLAY "Sezione" CODTAB[1,1]
DISPLAY "Lettera" CODTAB[2,2]
DISPLAY "Descrizione@50" S0
OUTPUT F_SEZ CODTAB[1,1]
OUTPUT F_LETT CODTAB[2,2]
OUTPUT F_DESCR_LETT S0
HELP "Lettera secondo la IV dir. CEE"
GROUP GR_SEARCH
END
STRING F_DESCR_LETT 50
BEGIN
PROMPT 22 3 ""
FLAGS "D"
END
NUMBER F_CLASSE 8 4
BEGIN
PROMPT 1 5 "Classe "
FIELD %IVD->CODTAB[3,6]
FLAGS "MZ"
KEY 1
COPY USE F_LETT
COPY INPUT F_LETT
INPUT CODTAB[3,6] F_CLASSE
DISPLAY "Sezione" CODTAB[1,1]
DISPLAY "Lettera" CODTAB[2,2]
DISPLAY "Classe " CODTAB[3,6]
DISPLAY "Descrizione@50" S0
OUTPUT F_SEZ CODTAB[1,1]
OUTPUT F_LETT CODTAB[2,2]
OUTPUT F_CLASSE CODTAB[3,6]
OUTPUT F_DESCR_CLAS S0
HELP "Classe secondo la IV dir. CEE (numero romano)"
END
STRING F_DESCR_CLAS 50
BEGIN
PROMPT 22 5 ""
FLAGS "D"
END
NUMBER F_NUM 2
BEGIN
PROMPT 1 7 "Numero "
FIELD %IVD->CODTAB[7,8]
FLAGS "RZ"
KEY 1
COPY USE F_LETT
COPY INPUT F_CLASSE
INPUT CODTAB[7,8] F_NUM
DISPLAY "Sezione" CODTAB[1,1]
DISPLAY "Lettera" CODTAB[2,2]
@ -41,35 +90,13 @@ BEGIN
OUTPUT F_CLASSE CODTAB[3,6]
OUTPUT F_NUM CODTAB[7,8]
OUTPUT F_DESCR S0
HELP "Lettera secondo la IV dir. CEE"
GROUP GR_SEARCH
END
NUMBER F_CLASSE 8 4
BEGIN
PROMPT 4 5 "Classe "
FIELD %IVD->CODTAB[3,6]
FLAGS "MZ"
KEY 1
COPY ALL F_LETT
HELP "Classe secondo la IV dir. CEE (numero romano)"
END
NUMBER F_NUM 2
BEGIN
PROMPT 4 7 "Numero "
FIELD %IVD->CODTAB[7,8]
FLAGS "RZ"
KEY 1
COPY ALL F_LETT
HELP "Numero (arabo) secondo la IV dir. CEE"
// VALIDATE AUTOEXIT_FUNC 3 F_LETT F_CLASSE F_NUM
VALIDATE AUTOEXIT_FUNC 2 F_LETT F_NUM
VALIDATE AUTOEXIT_FUNC 2 F_LETT F_NUM
END
STRING F_DESCR 50
BEGIN
PROMPT 4 9 "Descrizione "
PROMPT 22 7 ""
FIELD %IVD->S0
KEY 2
USE %IVD KEY 2
@ -79,7 +106,7 @@ BEGIN
DISPLAY "Lettera" CODTAB[2,2]
DISPLAY "Classe " CODTAB[3,6]
DISPLAY "Numero" CODTAB[7,8]
COPY OUTPUT F_CLASSE
COPY OUTPUT F_NUM
CHECKTYPE REQUIRED
END