Aggiunta funzione onereq (almeno un campo richiesto nella lista)

git-svn-id: svn://10.65.10.50/trunk@400 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1994-10-19 11:25:59 +00:00
parent 0a868c3469
commit e0efa12b64
2 changed files with 27 additions and 4 deletions

View File

@ -52,8 +52,10 @@
MTCHECK_FUNC mese corretto per MTCHECK_FUNC mese corretto per
ditta mensile o ditta mensile o
trimestrale trimestrale
REQIF_FUNC richiesto se immesso REQIF_FUNC richiesto se immesso un campo della lista
un campo della lista n.ro di campi lista di campi... n.ro di campi lista di campi...
ONEREQ_FUNC almeno uno non vuoto
n.ro campi lista di campi
*/ */
#define EXPR_FUNC 0 2 #define EXPR_FUNC 0 2
@ -72,6 +74,7 @@
#define AUTOEXIT_FUNC 13 #define AUTOEXIT_FUNC 13
#define NUMCALC_FUNC 14 #define NUMCALC_FUNC 14
#define STRCALC_FUNC 15 #define STRCALC_FUNC 15
#define ONEREQ_FUNC 16
#define VALEXPR VALIDATE EXPR_FUNC #define VALEXPR VALIDATE EXPR_FUNC
#define NUM_EXPR VALEXPR 0 #define NUM_EXPR VALEXPR 0

View File

@ -127,6 +127,8 @@ HIDDEN bool _pi_val(TEdit_field& f, KEY)
HIDDEN bool __cf_check (const char * codcf) HIDDEN bool __cf_check (const char * codcf)
{ {
const TFixed_string cf (codcf); const TFixed_string cf (codcf);
if (cf.len() != 16) return FALSE;
const TFixed_string tab("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"); const TFixed_string tab("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
int tot = 0, y; int tot = 0, y;
@ -527,7 +529,24 @@ HIDDEN bool _strcalc_val(TEdit_field& f, KEY k)
} }
#define MAX_FUNC 16 HIDDEN bool _onereq_val(TEdit_field& f, KEY k)
{
if (k != K_ENTER) return TRUE;
const TMask& m = f.mask();
if (m.mode() == MODE_QUERY) return TRUE;
const int nparms = get_val_param_num();
TString s;
for (int i = 0; i < nparms ; i++)
{
s = m.get(atoi(get_val_param(i)));
if (s.not_empty()) return TRUE;
}
return FALSE;
}
#define MAX_FUNC 17
HIDDEN VAL_FUNC _global_val_func[MAX_FUNC] = HIDDEN VAL_FUNC _global_val_func[MAX_FUNC] =
{ {
@ -546,7 +565,8 @@ HIDDEN VAL_FUNC _global_val_func[MAX_FUNC] =
_reqif_val, _reqif_val,
_autoexit_val, _autoexit_val,
_numcalc_val, _numcalc_val,
_strcalc_val _strcalc_val,
_onereq_val
}; };
bool validate(int fn, TEdit_field& f, KEY k, const TArray& parms) bool validate(int fn, TEdit_field& f, KEY k, const TArray& parms)