multirec.* Aggiunto confronto tra TMultiple_rectype
realpp.cpp Corretta gestione transazione INSERT git-svn-id: svn://10.65.10.50/trunk@6742 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
1e106d3046
commit
31b2527133
@ -119,6 +119,30 @@ int TMultiple_rectype::write_rewrite(TBaseisamfile & f, bool re) const
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @mfunc confronta due record multipli
|
||||||
|
int TMultiple_rectype::compare(const TSortable& s) const
|
||||||
|
{
|
||||||
|
int res = TRectype::compare(s);
|
||||||
|
TMultiple_rectype & m = (TMultiple_rectype &) s;
|
||||||
|
for (int i = 0 ; res == 0 && i < _files.items(); i++)
|
||||||
|
{
|
||||||
|
const int logicnum = _logicnums.get_int(i);
|
||||||
|
TRecord_array & r = body(logicnum);
|
||||||
|
TRecord_array & r1 = m.body(logicnum);
|
||||||
|
res = r.rows() - r1.rows();
|
||||||
|
if (res == 0 && r.rows() > 0 && r1.rows() > 0)
|
||||||
|
{
|
||||||
|
for (int j = r.first_row(), k = r1.first_row(); res == 0 && j >= 0 && k >= 0; j = r.succ_row(j), k = r1.succ_row(k))
|
||||||
|
{
|
||||||
|
res = j - k;
|
||||||
|
if (res == 0)
|
||||||
|
res = r[j] != r1[j];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
void TMultiple_rectype::remove_body(int logicnum)
|
void TMultiple_rectype::remove_body(int logicnum)
|
||||||
{
|
{
|
||||||
const int index = log2ind(logicnum);
|
const int index = log2ind(logicnum);
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include <varrec.h>
|
#include <varrec.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class TMultiple_rectype;
|
|
||||||
//**************************************
|
//**************************************
|
||||||
// classe per il controllo dei record composti da una testata e N file di righe
|
// classe per il controllo dei record composti da una testata e N file di righe
|
||||||
// è implementato come un TRectype che contiene anche un TRecord_array
|
// è implementato come un TRectype che contiene anche un TRecord_array
|
||||||
|
@ -861,16 +861,25 @@ void TRelation_application::main_loop()
|
|||||||
_recins = -1;
|
_recins = -1;
|
||||||
|
|
||||||
// Provoca l'autopremimento per il messaggio di LINK
|
// Provoca l'autopremimento per il messaggio di LINK
|
||||||
if (_lnflag)
|
if (_lnflag)
|
||||||
{
|
{
|
||||||
if (load_transaction())
|
if (_trans_counter < _ntransactions)
|
||||||
{
|
{
|
||||||
_autodelete = _curr_transaction == TRANSACTION_DELETE;
|
// la transazione è sul .ini : la carica
|
||||||
if (_curr_transaction == TRANSACTION_INSERT )
|
if (load_transaction())
|
||||||
_mask->send_key(K_CTRL+'N', 0);
|
{
|
||||||
}
|
// la transazione necessita di autopremimento
|
||||||
if (_curr_transaction !=TRANSACTION_RUN)
|
_autodelete = _curr_transaction == TRANSACTION_DELETE;
|
||||||
|
if (_curr_transaction == TRANSACTION_INSERT )
|
||||||
|
_mask->send_key(K_CTRL+'N', 0);
|
||||||
|
else
|
||||||
|
_mask->send_key(K_AUTO_ENTER, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // la transazione non è sul .ini
|
||||||
|
{
|
||||||
_mask->send_key(K_AUTO_ENTER, 0);
|
_mask->send_key(K_AUTO_ENTER, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query_mode();
|
query_mode();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user