diff --git a/include/recarray.cpp b/include/recarray.cpp index ca0dcee7f..e32e9f3ee 100755 --- a/include/recarray.cpp +++ b/include/recarray.cpp @@ -465,7 +465,13 @@ void TFile_cache::construct(int key) TFile_cache::TFile_cache(TLocalisamfile* f , int key) { construct(key); - _filecode << f->num(); + switch (f->num()) + { + case LF_TABCOM: _filecode << '%' << f->name(); break; + case LF_TAB : _filecode = f->name(); break; + case LF_TABMOD: _filecode << '&' << f->name(); break; + default : _filecode << f->num(); break; + } init_file(f); } @@ -714,7 +720,16 @@ TObject* TDecoder::rec2obj(const TRectype& curr) const const TString& TDecoder::decode(const char* code) { - const TString& obj = (const TString&)query(code); + TString80 key; + switch (file().num()) + { + case LF_TABMOD: key << file().get("MOD") << '|' << file().get("CUST") << '|'; // Fall down + case LF_TAB: + case LF_TABCOM: key << file().name() << '|'; break; + default: break; + } + key << code; + const TString& obj = (const TString&)query(key); return obj; } diff --git a/include/recarray.h b/include/recarray.h index 61fc87e33..e05d1d990 100755 --- a/include/recarray.h +++ b/include/recarray.h @@ -152,7 +152,7 @@ class TFile_cache : public TObject static unsigned long _hits, _misses; TToken_string _code; - TString4 _filecode; + TString4 _filecode; // Codice tabella es: %STA, &AUT TLocalisamfile* _file; int _key; long _last_firm, _limit; @@ -170,7 +170,7 @@ protected: const TObject& query(const char* chiave); virtual TObject* rec2obj(const TRectype& rec) const pure; - TLocalisamfile & file(); + TLocalisamfile& file(); public: virtual bool discard(const char* victim); diff --git a/include/varrec.cpp b/include/varrec.cpp index fa4fcd6fa..f5bc9c8cf 100755 --- a/include/varrec.cpp +++ b/include/varrec.cpp @@ -205,9 +205,10 @@ void TVariable_rectype::set_memo_fld( const char * fieldname) { if (fieldname && *fieldname) { - CHECKS(exist(fieldname), "Unknown memo field", fieldname); - CHECKS(type(fieldname) == _memofld, "Incorrect field type", fieldname); - _memo_fld = fieldname; + if (type(fieldname) == _memofld) + _memo_fld = fieldname; + else + NFCHECK("Campo memo non esistente %s", fieldname); } else _memo_fld.cut(0);