Patch level : 10.0
Files correlati : f22.dir f22.trr Ricompilazione Demo : [ ] Commento : Aggiornati tracciati record allegatiin base alle specifiche in "totalone.pdf" (nome originale del file ministeriale ottenuto tramite copia e incolla casuale) git-svn-id: svn://10.65.10.50/branches/R_10_00@22374 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
1317834b58
commit
0029f96c42
@ -17,7 +17,6 @@ DEFFLD(NUMREG) // Can be null
|
|||||||
|
|
||||||
// Flags
|
// Flags
|
||||||
DEFFLD(IGNORA)
|
DEFFLD(IGNORA)
|
||||||
DEFFLD(CONTRATTO)
|
|
||||||
|
|
||||||
// Content fields
|
// Content fields
|
||||||
DEFFLD(DATAREG)
|
DEFFLD(DATAREG)
|
||||||
@ -26,7 +25,12 @@ DEFFLD(IMPORTO)
|
|||||||
DEFFLD(IMPOSTA)
|
DEFFLD(IMPOSTA)
|
||||||
DEFFLD(NATOPE)
|
DEFFLD(NATOPE)
|
||||||
DEFFLD(TIPOPE)
|
DEFFLD(TIPOPE)
|
||||||
DEFFLD(TOTALE)
|
|
||||||
|
DEFFLD(CONTRATTO)
|
||||||
|
DEFFLD(IMPORTOTOT)
|
||||||
|
DEFFLD(IMPOSTATOT)
|
||||||
|
|
||||||
|
DEFFLD(NUMRETT)
|
||||||
|
|
||||||
#undef DEFFLD
|
#undef DEFFLD
|
||||||
|
|
||||||
|
@ -20,7 +20,10 @@ TFast_isamfile::TFast_isamfile(int logicnum) : TIsamfile(logicnum)
|
|||||||
}
|
}
|
||||||
|
|
||||||
TFast_isamfile::~TFast_isamfile()
|
TFast_isamfile::~TFast_isamfile()
|
||||||
{ close(); }
|
{
|
||||||
|
close();
|
||||||
|
// prefix().close_closeable_isamfiles(); // Non strettamente necessario
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TRecord_Array
|
// TRecord_Array
|
||||||
@ -58,7 +61,7 @@ TRecord_array::TRecord_array(const char* keytok, int logicnum, int first)
|
|||||||
if (keytok && *keytok) // La stringa chiave non e' vuota
|
if (keytok && *keytok) // La stringa chiave non e' vuota
|
||||||
{
|
{
|
||||||
const TToken_string key(keytok);
|
const TToken_string key(keytok);
|
||||||
TString80 val; // Un campo chiave non puo' mai superare i 50
|
TString80 val; // Un campo chiave non puo' mai superare i 70 (4->S0)
|
||||||
for (int i = 0; i < kd.NkFields-1; i++) // Riempio "quasi" tutta la chiave primaria
|
for (int i = 0; i < kd.NkFields-1; i++) // Riempio "quasi" tutta la chiave primaria
|
||||||
{
|
{
|
||||||
const int nPos = kd.FieldSeq[i] % MaxFields; // Posizione del campo i della chiave
|
const int nPos = kd.FieldSeq[i] % MaxFields; // Posizione del campo i della chiave
|
||||||
@ -88,7 +91,7 @@ void TRecord_array::set_key(TRectype* r)
|
|||||||
const KeyDes& kd = recd.Ky[0]; // Elenco dei campi della chiave 1
|
const KeyDes& kd = recd.Ky[0]; // Elenco dei campi della chiave 1
|
||||||
|
|
||||||
// Copia tutti i campi chiave, tranne l'ultimo, in tutti i records
|
// Copia tutti i campi chiave, tranne l'ultimo, in tutti i records
|
||||||
TString val;
|
TString80 val;
|
||||||
for (int i = kd.NkFields-2; i >= 0; i--)
|
for (int i = kd.NkFields-2; i >= 0; i--)
|
||||||
{
|
{
|
||||||
const int nf = kd.FieldSeq[i] % MaxFields;
|
const int nf = kd.FieldSeq[i] % MaxFields;
|
||||||
@ -104,7 +107,6 @@ const TRectype& TRecord_array::key() const
|
|||||||
{
|
{
|
||||||
const TRectype* r = (const TRectype*)_data.objptr(0);
|
const TRectype* r = (const TRectype*)_data.objptr(0);
|
||||||
CHECK(r != NULL, "TRecord_array lost its key");
|
CHECK(r != NULL, "TRecord_array lost its key");
|
||||||
|
|
||||||
return *r;
|
return *r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +187,10 @@ void TRecord_array::sort(COMPARE_FUNCTION sort_func)
|
|||||||
_data.insert(rec,0); // ripristina chiave
|
_data.insert(rec,0); // ripristina chiave
|
||||||
TString16 n;
|
TString16 n;
|
||||||
for (int i = _data.last(); i > 0; i--)
|
for (int i = _data.last(); i > 0; i--)
|
||||||
row(i, false).renum_key(_num, n.format("%d", i)); // Rinumera
|
{
|
||||||
|
n.cut(0) << i;
|
||||||
|
row(i, false).renum_key(_num, n); // Rinumera
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int TRecord_array::rec2row(const TRectype& r) const
|
int TRecord_array::rec2row(const TRectype& r) const
|
||||||
@ -207,9 +212,8 @@ int TRecord_array::insert_row(TRectype* r)
|
|||||||
TString16 n;
|
TString16 n;
|
||||||
for (int f = _data.last(); f > nr; f = _data.pred(f))
|
for (int f = _data.last(); f > nr; f = _data.pred(f))
|
||||||
{
|
{
|
||||||
TRectype& rec = row(f, FALSE);
|
TRectype& rec = row(f, false);
|
||||||
|
n.cut(0) << long(_offset + f);
|
||||||
n.format("%ld", (long)_offset + f);
|
|
||||||
rec.renum_key(_num, n);
|
rec.renum_key(_num, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,12 +238,13 @@ void TRecord_array::pack()
|
|||||||
{
|
{
|
||||||
_data.pack();
|
_data.pack();
|
||||||
|
|
||||||
|
TString16 n;
|
||||||
for (int i = _data.last(); i > 0; i--)
|
for (int i = _data.last(); i > 0; i--)
|
||||||
{
|
{
|
||||||
TRectype* r = (TRectype*)_data.objptr(i);
|
TRectype* r = (TRectype*)_data.objptr(i);
|
||||||
if (r != NULL)
|
if (r != NULL)
|
||||||
{
|
{
|
||||||
TString16 n; n << i+_offset;
|
n.cut(0) << long(i+_offset);
|
||||||
r->renum_key(_num, n);
|
r->renum_key(_num, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -266,12 +271,13 @@ bool TRecord_array::destroy_row(
|
|||||||
|
|
||||||
if (ok && pack)
|
if (ok && pack)
|
||||||
{
|
{
|
||||||
|
TString16 n;
|
||||||
for (int i = _data.size()-1; i >= index; i--)
|
for (int i = _data.size()-1; i >= index; i--)
|
||||||
{
|
{
|
||||||
TRectype* r = (TRectype*)_data.objptr(i);
|
TRectype* r = (TRectype*)_data.objptr(i);
|
||||||
if (r != NULL)
|
if (r != NULL)
|
||||||
{
|
{
|
||||||
TString16 n; n << i+_offset;
|
n.cut(0) << long(i+_offset);
|
||||||
r->renum_key(_num, n);
|
r->renum_key(_num, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user