Ho tolto la ricerca incrementale nei casi difficili (chiavi composte)

HO scelto il nome del file indice dei cursori al momento del loro utilizzo.


git-svn-id: svn://10.65.10.50/trunk@430 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1994-10-20 13:32:24 +00:00
parent d8283b4f7b
commit 5b160aa49d
5 changed files with 19 additions and 12 deletions

View File

@ -1,4 +1,4 @@
// $Id: maskfld.cpp,v 1.33 1994-10-19 15:00:23 guy Exp $ // $Id: maskfld.cpp,v 1.34 1994-10-20 13:32:15 guy Exp $
#include <xvt.h> #include <xvt.h>
#include <applicat.h> #include <applicat.h>
@ -1411,7 +1411,9 @@ KEY TBrowse::run()
KEY k = K_ESC; KEY k = K_ESC;
long selected = 0; long selected = 0;
TToken_string siblings; create_siblings(siblings); TToken_string siblings;
if (_inp_id.items() == 1)
create_siblings(siblings);
{ {
TToken_string* sib = siblings.empty() ? NULL : &siblings; TToken_string* sib = siblings.empty() ? NULL : &siblings;

View File

@ -1,4 +1,4 @@
// $Id: relapp.cpp,v 1.17 1994-10-19 11:49:19 alex Exp $ // $Id: relapp.cpp,v 1.18 1994-10-20 13:32:20 guy Exp $
#include <mailbox.h> #include <mailbox.h>
#include <sheet.h> #include <sheet.h>
#include <urldefid.h> #include <urldefid.h>
@ -727,7 +727,7 @@ bool TRelation_application::main_loop()
} }
break; break;
case K_INS: case K_INS:
if (_mask->query_mode() || _mask->save(TRUE)) if (_mask->query_mode() || save(FALSE))
insert_mode(); insert_mode();
break; break;
case K_DEL: case K_DEL:

View File

@ -1,4 +1,4 @@
// $Id: relation.cpp,v 1.18 1994-10-17 11:41:09 alex Exp $ // $Id: relation.cpp,v 1.19 1994-10-20 13:32:22 guy Exp $
// relation.cpp // relation.cpp
// fv 12/8/93 // fv 12/8/93
// relation class for isam files // relation class for isam files
@ -649,7 +649,7 @@ HIDDEN bool __evalcondition(const TRectype& r,TExpression* cond)
return (bool) *cond; return (bool) *cond;
} }
FILE* TCursor::open_index(bool create) const FILE* TCursor::open_index(bool create)
{ {
#if XVT_OS == XVT_OS_SCOUNIX #if XVT_OS == XVT_OS_SCOUNIX
const char* const r = "r"; const char* const r = "r";
@ -659,6 +659,11 @@ FILE* TCursor::open_index(bool create) const
const char* const w = "wb"; const char* const w = "wb";
#endif #endif
if (create)
{
CHECKS(_indexname.empty(), "Can't rename cursor index ", (const char*)_indexname);
_indexname.temp("ci$$");
}
FILE* f = fopen(_indexname, create ? w : r); FILE* f = fopen(_indexname, create ? w : r);
if (f == NULL) if (f == NULL)
fatal_box("Can't use cursor index for file %d: '%s'\n", fatal_box("Can't use cursor index for file %d: '%s'\n",
@ -951,7 +956,6 @@ TCursor::TCursor(TRelation* r, const char* filter, int nkey, TRectype *from, TRe
_if = r; _if = r;
_nkey = nkey; _nkey = nkey;
CHECKD(_nkey > 0 && _nkey <= file().filehnd()->r->NKeys, "Bad key number : ", _nkey); CHECKD(_nkey > 0 && _nkey <= file().filehnd()->r->NKeys, "Bad key number : ", _nkey);
_indexname.temp("ci");
_pos = 0; _pos = 0;
_totrec = 0; _totrec = 0;
@ -995,6 +999,7 @@ TCursor::TCursor(TRelation* r, const char* filter, int nkey, TRectype *from, TRe
TCursor::~TCursor() TCursor::~TCursor()
{ {
if (_indexname.not_empty())
::remove(_indexname); ::remove(_indexname);
if (_fexpr) delete _fexpr; if (_fexpr) delete _fexpr;
} }

View File

@ -1,4 +1,4 @@
/* $Id: relation.h,v 1.7 1994-09-27 10:19:34 alex Exp $ */ /* $Id: relation.h,v 1.8 1994-10-20 13:32:24 guy Exp $ */
// join.h // join.h
// fv 12/8/93 // fv 12/8/93
// join class for isam files // join class for isam files
@ -171,7 +171,7 @@ class TCursor : public TObject
int filtercursor(int pagecnt, TRecnotype* page); int filtercursor(int pagecnt, TRecnotype* page);
bool changed(); bool changed();
FILE* open_index(bool create = FALSE) const; FILE* open_index(bool create = FALSE);
TRecnotype update(); TRecnotype update();
@ -241,7 +241,7 @@ class TFieldref : public TObject
// @DPRIV // @DPRIV
short _fileid; // Numero del file short _fileid; // Numero del file
TString16 _id; // Nome tabella o stringa col numero del file TString16 _id; // Nome tabella o stringa col numero del file
TString16 _name; // Nome del campo TString80 _name; // Nome del campo
int _from, _to; // Substring int _from, _to; // Substring
protected: protected: