Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : codeb.c Migliorata la funzione static find_slash_backslash config.cpp Tolto messaggio di creazione config, in quanto blocca il programma se viene mostrato durante la create! expr.h Trasformate in TString80 alcune TString form.* Aggiunto metodo per accedere ai campi per numero git-svn-id: svn://10.65.10.50/trunk@6947 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3adc6b1566
commit
bcaa4baf58
@ -48,7 +48,8 @@
|
|||||||
#include <checks.h>
|
#include <checks.h>
|
||||||
#define MAXLEN 137 /* Lunghezza massima chiave */
|
#define MAXLEN 137 /* Lunghezza massima chiave */
|
||||||
|
|
||||||
extern char* CUpString(char *);
|
//extern char* CUpString(char *);
|
||||||
|
#define CUpString(str) _strupr(str)
|
||||||
|
|
||||||
static CODE4 code_base;
|
static CODE4 code_base;
|
||||||
static DATA4 *dbdata[CB4FILES];
|
static DATA4 *dbdata[CB4FILES];
|
||||||
@ -58,19 +59,27 @@ bool handle_ok(int handle)
|
|||||||
return handle >= 0 && handle < CB4FILES && dbdata[handle] !=0;
|
return handle >= 0 && handle < CB4FILES && dbdata[handle] !=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char * find_slash_backslash(char * str)
|
static char* find_slash_backslash(const char* s)
|
||||||
{
|
{
|
||||||
static char* xstr = NULL;
|
/*
|
||||||
int l=strlen(str);
|
const int l = strlen(str);
|
||||||
xstr = str + l;
|
const char* xstr = str + l;
|
||||||
|
|
||||||
while (xstr-- && l--)
|
while (xstr-- && l--)
|
||||||
if (*xstr == '\\' || *xstr == '/')
|
if (*xstr == '\\' || *xstr == '/' || l <= 0)
|
||||||
break;
|
break;
|
||||||
if (l == 0)
|
if (l <= 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
else
|
else
|
||||||
return xstr;
|
return xstr;
|
||||||
|
*/
|
||||||
|
|
||||||
|
const char* slash = NULL;
|
||||||
|
for ( ; *s; s++)
|
||||||
|
{
|
||||||
|
if (*s == '\\' || *s == '/')
|
||||||
|
slash = s;
|
||||||
|
}
|
||||||
|
return (char*)slash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -646,7 +646,7 @@ TConfig::TConfig(int which_config, const char* paragraph)
|
|||||||
case CONFIG_DITTA:
|
case CONFIG_DITTA:
|
||||||
_file = firm2dir(prefix().get_codditta());
|
_file = firm2dir(prefix().get_codditta());
|
||||||
_file.add("prassid.ini");
|
_file.add("prassid.ini");
|
||||||
if (!fexist(_file))
|
if (!fexist(_file) && fexist("prassid.ini"))
|
||||||
fcopy("prassid.ini", _file);
|
fcopy("prassid.ini", _file);
|
||||||
break;
|
break;
|
||||||
case CONFIG_STUDIO:
|
case CONFIG_STUDIO:
|
||||||
@ -661,7 +661,7 @@ TConfig::TConfig(int which_config, const char* paragraph)
|
|||||||
{
|
{
|
||||||
case CONFIG_STUDIO:
|
case CONFIG_STUDIO:
|
||||||
_file.add("prassis.ini");
|
_file.add("prassis.ini");
|
||||||
if (!_file.exist())
|
if (!_file.exist() && fexist("prassis.ini"))
|
||||||
fcopy("prassis.ini", _file);
|
fcopy("prassis.ini", _file);
|
||||||
break;
|
break;
|
||||||
case CONFIG_STAMPE:
|
case CONFIG_STAMPE:
|
||||||
@ -696,11 +696,11 @@ TConfig::TConfig(int which_config, const char* paragraph)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_file = "prassi.ini";
|
_file = "prassi.ini";
|
||||||
CHECK(0, "Chi ca$$o usa prassi.ini?");
|
NFCHECK("Chi usa prassi.ini?");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
init(_file, paragraph, TRUE);
|
init(_file, paragraph, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
TConfig::TConfig(const char *fn, const char* pa)
|
TConfig::TConfig(const char *fn, const char* pa)
|
||||||
|
@ -91,7 +91,7 @@ class TValue : public TObject
|
|||||||
// @cmember:(INTERNAL) Valore real
|
// @cmember:(INTERNAL) Valore real
|
||||||
real _r;
|
real _r;
|
||||||
// @cmember:(INTERNAL) Valore in formato stringa
|
// @cmember:(INTERNAL) Valore in formato stringa
|
||||||
TString _s;
|
TString80 _s;
|
||||||
// @cmember:(INTERNAL) Tipo preferito
|
// @cmember:(INTERNAL) Tipo preferito
|
||||||
TTypeexp _t;
|
TTypeexp _t;
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ class TVar : public TObject
|
|||||||
{
|
{
|
||||||
|
|
||||||
// @cmember:(INTERNAL) Nome della variabile
|
// @cmember:(INTERNAL) Nome della variabile
|
||||||
TString _name;
|
TString80 _name;
|
||||||
// @cmember:(INTERNAL) Valore assegnato alla variabile
|
// @cmember:(INTERNAL) Valore assegnato alla variabile
|
||||||
TValue _val;
|
TValue _val;
|
||||||
|
|
||||||
|
@ -411,13 +411,13 @@ void TForm_item::print_body(ostream& out) const
|
|||||||
aa.restart();
|
aa.restart();
|
||||||
|
|
||||||
THash_object* op;
|
THash_object* op;
|
||||||
|
TString typ, val, des;
|
||||||
while ((op = aa.get_hashobj()) != NULL)
|
while ((op = aa.get_hashobj()) != NULL)
|
||||||
{
|
{
|
||||||
TToken_string& t = (TToken_string&)op->obj();
|
TToken_string& t = (TToken_string&)op->obj();
|
||||||
TString typ(t.get(0));
|
typ = t.get(0);
|
||||||
TString val(t.get(1));
|
val = t.get(1);
|
||||||
TString des(t.get(2));
|
des = t.get(2);
|
||||||
out << " SPECIAL " << typ << " " << op->key()
|
out << " SPECIAL " << typ << " " << op->key()
|
||||||
<< " \"" << val << "\" \"" << des << "\"\n";
|
<< " \"" << val << "\" \"" << des << "\"\n";
|
||||||
}
|
}
|
||||||
|
@ -1099,11 +1099,12 @@ protected:
|
|||||||
|
|
||||||
virtual TToken_string& memo_info() { return _memo; }
|
virtual TToken_string& memo_info() { return _memo; }
|
||||||
|
|
||||||
TFieldref& field(int i) const { return (TFieldref&)_field[i]; }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual TObject* dup() const;
|
virtual TObject* dup() const;
|
||||||
|
|
||||||
|
TFieldref& field(int i) const { return (TFieldref&)_field[i]; }
|
||||||
virtual const int fields() { return _field.items();}
|
virtual const int fields() { return _field.items();}
|
||||||
|
|
||||||
virtual const TString& picture() const { return _picture; }
|
virtual const TString& picture() const { return _picture; }
|
||||||
virtual void set_picture(const char* p) { _picture = p; }
|
virtual void set_picture(const char* p) { _picture = p; }
|
||||||
virtual void apply_format(TString & s) const;
|
virtual void apply_format(TString & s) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user