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:
guy 1998-08-10 10:15:30 +00:00
parent 3adc6b1566
commit bcaa4baf58
5 changed files with 30 additions and 20 deletions

View File

@ -48,7 +48,8 @@
#include <checks.h>
#define MAXLEN 137 /* Lunghezza massima chiave */
extern char* CUpString(char *);
//extern char* CUpString(char *);
#define CUpString(str) _strupr(str)
static CODE4 code_base;
static DATA4 *dbdata[CB4FILES];
@ -58,19 +59,27 @@ bool handle_ok(int handle)
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);
xstr = str + l;
/*
const int l = strlen(str);
const char* xstr = str + l;
while (xstr-- && l--)
if (*xstr == '\\' || *xstr == '/')
if (*xstr == '\\' || *xstr == '/' || l <= 0)
break;
if (l == 0)
if (l <= 0)
return NULL;
else
return xstr;
*/
const char* slash = NULL;
for ( ; *s; s++)
{
if (*s == '\\' || *s == '/')
slash = s;
}
return (char*)slash;
}

View File

@ -646,7 +646,7 @@ TConfig::TConfig(int which_config, const char* paragraph)
case CONFIG_DITTA:
_file = firm2dir(prefix().get_codditta());
_file.add("prassid.ini");
if (!fexist(_file))
if (!fexist(_file) && fexist("prassid.ini"))
fcopy("prassid.ini", _file);
break;
case CONFIG_STUDIO:
@ -661,7 +661,7 @@ TConfig::TConfig(int which_config, const char* paragraph)
{
case CONFIG_STUDIO:
_file.add("prassis.ini");
if (!_file.exist())
if (!_file.exist() && fexist("prassis.ini"))
fcopy("prassis.ini", _file);
break;
case CONFIG_STAMPE:
@ -696,11 +696,11 @@ TConfig::TConfig(int which_config, const char* paragraph)
break;
default:
_file = "prassi.ini";
CHECK(0, "Chi ca$$o usa prassi.ini?");
NFCHECK("Chi usa prassi.ini?");
break;
}
init(_file, paragraph, TRUE);
init(_file, paragraph, FALSE);
}
TConfig::TConfig(const char *fn, const char* pa)

View File

@ -91,7 +91,7 @@ class TValue : public TObject
// @cmember:(INTERNAL) Valore real
real _r;
// @cmember:(INTERNAL) Valore in formato stringa
TString _s;
TString80 _s;
// @cmember:(INTERNAL) Tipo preferito
TTypeexp _t;
@ -254,7 +254,7 @@ class TVar : public TObject
{
// @cmember:(INTERNAL) Nome della variabile
TString _name;
TString80 _name;
// @cmember:(INTERNAL) Valore assegnato alla variabile
TValue _val;

View File

@ -411,13 +411,13 @@ void TForm_item::print_body(ostream& out) const
aa.restart();
THash_object* op;
TString typ, val, des;
while ((op = aa.get_hashobj()) != NULL)
{
TToken_string& t = (TToken_string&)op->obj();
TString typ(t.get(0));
TString val(t.get(1));
TString des(t.get(2));
typ = t.get(0);
val = t.get(1);
des = t.get(2);
out << " SPECIAL " << typ << " " << op->key()
<< " \"" << val << "\" \"" << des << "\"\n";
}

View File

@ -1099,11 +1099,12 @@ protected:
virtual TToken_string& memo_info() { return _memo; }
TFieldref& field(int i) const { return (TFieldref&)_field[i]; }
public:
virtual TObject* dup() const;
TFieldref& field(int i) const { return (TFieldref&)_field[i]; }
virtual const int fields() { return _field.items();}
virtual const TString& picture() const { return _picture; }
virtual void set_picture(const char* p) { _picture = p; }
virtual void apply_format(TString & s) const;