Patch level : 10.0
Files correlati : lv0 Ricompilazione Demo : [ ] Commento : Corretta interpretazione tabelle di modulo in stampa git-svn-id: svn://10.65.10.50/trunk@17387 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7ff61ff37b
commit
66c5543e7a
@ -1,19 +1,15 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <expr.h>
|
#include <expr.h>
|
||||||
#include <files.h>
|
#include <files.h>
|
||||||
|
#include <lffiles.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <extcdecl.h>
|
#include <extcdecl.h>
|
||||||
#include <lffiles.h>
|
|
||||||
|
|
||||||
#define BLOCKLEN 512
|
#define BLOCKLEN 512
|
||||||
#define INVFLD 255
|
#define INVFLD 255
|
||||||
|
|
||||||
HIDDEN char _files_tmp_string[256];
|
|
||||||
|
|
||||||
TFile::TFile (int lenrec, int base)
|
TFile::TFile (int lenrec, int base)
|
||||||
{
|
{
|
||||||
_file = new SecDef;
|
_file = new SecDef;
|
||||||
@ -138,25 +134,26 @@ const char *TDir::name () const
|
|||||||
return _dir->SysName;
|
return _dir->SysName;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *TDir::filename () const
|
const char* TDir::filename() const
|
||||||
{
|
{
|
||||||
strcpy(_files_tmp_string, CAddPref(_dir->SysName));
|
TString& tmp = get_tmp_string();
|
||||||
for (int i=strlen(_files_tmp_string); i>0; i--)
|
tmp = CAddPref(_dir->SysName);
|
||||||
|
for (int i=tmp.len()-1; i>=0; i--)
|
||||||
{
|
{
|
||||||
const char c = _files_tmp_string[i-1];
|
const char c = tmp[i];
|
||||||
if (c == '\\' || c == '/')
|
if (is_slash(c))
|
||||||
{
|
{
|
||||||
strcat(_files_tmp_string, ".dbf");
|
tmp << ".dbf";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (c == '.')
|
if (c == '.')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return _files_tmp_string;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TDir::set_name (const char * name)
|
void TDir::set_name(const char* name)
|
||||||
{
|
{
|
||||||
CHECK(name != NULL, "NULL Filename");
|
CHECK(name != NULL, "NULL Filename");
|
||||||
CHECK(strlen(name) < 42, "Name too long");
|
CHECK(strlen(name) < 42, "Name too long");
|
||||||
@ -316,12 +313,16 @@ void TDir::print_on (ostream & out) const
|
|||||||
void TDir::read_from (istream & in)
|
void TDir::read_from (istream & in)
|
||||||
{
|
{
|
||||||
CHECK(_dir,"Can't read into a NULL _dir");
|
CHECK(_dir,"Can't read into a NULL _dir");
|
||||||
in.getline (_files_tmp_string, sizeof (_files_tmp_string), '\n');
|
TToken_string line(256, '|');
|
||||||
_num = atoi(_files_tmp_string);
|
char* buf = line.get_buffer();
|
||||||
in.getline (_files_tmp_string, sizeof (_files_tmp_string), '\n');
|
const int bufsize = line.size();
|
||||||
_com = atoi(_files_tmp_string) != 0;
|
|
||||||
in.getline (_files_tmp_string, sizeof (_files_tmp_string), '\n');
|
in.getline (buf, bufsize, '\n');
|
||||||
TToken_string line(_files_tmp_string,'|');
|
_num = atoi(buf);
|
||||||
|
in.getline (buf, bufsize, '\n');
|
||||||
|
_com = atoi(buf) != 0;
|
||||||
|
in.getline (buf, bufsize, '\n');
|
||||||
|
|
||||||
line.restart();
|
line.restart();
|
||||||
strcpy(_dir->SysName,line.get());
|
strcpy(_dir->SysName,line.get());
|
||||||
_dir->EOD = line.get_long();
|
_dir->EOD = line.get_long();
|
||||||
@ -531,17 +532,17 @@ int TTrec::field(const char *name) const
|
|||||||
return findfld(_rec, name);
|
return findfld(_rec, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *TTrec ::fielddef (int fld) const
|
const char* TTrec::fielddef(int fld) const
|
||||||
{
|
{
|
||||||
sprintf (_files_tmp_string, "%s|%d|%d|%d", _rec->Fd[fld].Name,
|
const RecFieldDes& fd = _rec->Fd[fld];
|
||||||
(int) _rec->Fd[fld].TypeF, (int) _rec->Fd[fld].Len,
|
TString& tmp = get_tmp_string(50);
|
||||||
(int) _rec->Fd[fld].Dec);
|
tmp.format("%s|%d|%d|%d", fd.Name, (int)fd.TypeF, (int)fd.Len, (int)fd.Dec);
|
||||||
return _files_tmp_string;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *TTrec ::keydef (int key) const
|
const char *TTrec ::keydef (int key) const
|
||||||
{
|
{
|
||||||
TFixed_string s (_files_tmp_string, 128);
|
TString& s = get_tmp_string(128);
|
||||||
|
|
||||||
s = "";
|
s = "";
|
||||||
for (int j = 0; j < _rec->Ky[key].NkFields; j++)
|
for (int j = 0; j < _rec->Ky[key].NkFields; j++)
|
||||||
@ -561,7 +562,7 @@ const char *TTrec ::keydef (int key) const
|
|||||||
s << ")";
|
s << ")";
|
||||||
}
|
}
|
||||||
s << (_rec->Ky[key].DupKeys ? "|X" : "| ");
|
s << (_rec->Ky[key].DupKeys ? "|X" : "| ");
|
||||||
return (const char *) s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TTrec::len() const
|
int TTrec::len() const
|
||||||
|
@ -1030,6 +1030,7 @@ void TCursor_parser::parse_region(TRectype& rec)
|
|||||||
{
|
{
|
||||||
field = ass.left(equal);
|
field = ass.left(equal);
|
||||||
value = ass.mid(equal+1);
|
value = ass.mid(equal+1);
|
||||||
|
value.trim();
|
||||||
if (value[0] == '"' || value[0] == '\'')
|
if (value[0] == '"' || value[0] == '\'')
|
||||||
{
|
{
|
||||||
value.rtrim(1);
|
value.rtrim(1);
|
||||||
@ -1217,7 +1218,7 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
|
|||||||
if (logicnum == LF_MAG && tok == "MAG") // Faccio prevalere la tabella MAG sul file MAG
|
if (logicnum == LF_MAG && tok == "MAG") // Faccio prevalere la tabella MAG sul file MAG
|
||||||
logicnum = LF_TAB;
|
logicnum = LF_TAB;
|
||||||
|
|
||||||
if (logicnum == LF_TAB || logicnum == LF_TABCOM)
|
if (logicnum == LF_TAB || logicnum == LF_TABCOM || logicnum == LF_TABMOD)
|
||||||
_relation = new TRelation(tok);
|
_relation = new TRelation(tok);
|
||||||
else
|
else
|
||||||
_relation = new TRelation(logicnum);
|
_relation = new TRelation(logicnum);
|
||||||
@ -1257,6 +1258,7 @@ TCursor_parser::TCursor_parser(istream& instr, TArray& col)
|
|||||||
if (_cursor == NULL)
|
if (_cursor == NULL)
|
||||||
_cursor = new TCursor(_relation, "", key);
|
_cursor = new TCursor(_relation, "", key);
|
||||||
|
|
||||||
|
_relation->lfile().zero(); // Azzera correttamente tabelle normali e di modulo!
|
||||||
TRectype rec_start(_relation->curr());
|
TRectype rec_start(_relation->curr());
|
||||||
TRectype rec_stop(rec_start);
|
TRectype rec_stop(rec_start);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user