From 5b160aa49deaf57b90eded4acabd76110d81793f Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 20 Oct 1994 13:32:24 +0000 Subject: [PATCH] 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 --- include/maskfld.cpp | 6 ++++-- include/prassi.ver | 2 +- include/relapp.cpp | 4 ++-- include/relation.cpp | 13 +++++++++---- include/relation.h | 6 +++--- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/include/maskfld.cpp b/include/maskfld.cpp index d7621a095..dec57f388 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -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 #include @@ -1411,7 +1411,9 @@ KEY TBrowse::run() KEY k = K_ESC; 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; diff --git a/include/prassi.ver b/include/prassi.ver index 8151c23ce..5ef53fd24 100755 --- a/include/prassi.ver +++ b/include/prassi.ver @@ -1 +1 @@ -#define VERSION 1.11 +#define VERSION 1.11 diff --git a/include/relapp.cpp b/include/relapp.cpp index 120ba43c2..b14242a1a 100755 --- a/include/relapp.cpp +++ b/include/relapp.cpp @@ -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 #include #include @@ -727,7 +727,7 @@ bool TRelation_application::main_loop() } break; case K_INS: - if (_mask->query_mode() || _mask->save(TRUE)) + if (_mask->query_mode() || save(FALSE)) insert_mode(); break; case K_DEL: diff --git a/include/relation.cpp b/include/relation.cpp index b2392c383..99d643eef 100755 --- a/include/relation.cpp +++ b/include/relation.cpp @@ -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 // fv 12/8/93 // relation class for isam files @@ -649,7 +649,7 @@ HIDDEN bool __evalcondition(const TRectype& r,TExpression* cond) return (bool) *cond; } -FILE* TCursor::open_index(bool create) const +FILE* TCursor::open_index(bool create) { #if XVT_OS == XVT_OS_SCOUNIX const char* const r = "r"; @@ -659,6 +659,11 @@ FILE* TCursor::open_index(bool create) const const char* const w = "wb"; #endif + if (create) + { + CHECKS(_indexname.empty(), "Can't rename cursor index ", (const char*)_indexname); + _indexname.temp("ci$$"); + } FILE* f = fopen(_indexname, create ? w : r); if (f == NULL) 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; _nkey = nkey; CHECKD(_nkey > 0 && _nkey <= file().filehnd()->r->NKeys, "Bad key number : ", _nkey); - _indexname.temp("ci"); _pos = 0; _totrec = 0; @@ -995,7 +999,8 @@ TCursor::TCursor(TRelation* r, const char* filter, int nkey, TRectype *from, TRe TCursor::~TCursor() { - ::remove(_indexname); + if (_indexname.not_empty()) + ::remove(_indexname); if (_fexpr) delete _fexpr; } diff --git a/include/relation.h b/include/relation.h index a4c60156c..2dc43bf39 100755 --- a/include/relation.h +++ b/include/relation.h @@ -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 // fv 12/8/93 // join class for isam files @@ -171,7 +171,7 @@ class TCursor : public TObject int filtercursor(int pagecnt, TRecnotype* page); bool changed(); - FILE* open_index(bool create = FALSE) const; + FILE* open_index(bool create = FALSE); TRecnotype update(); @@ -241,7 +241,7 @@ 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 + TString80 _name; // Nome del campo int _from, _to; // Substring protected: