From d203edbc086e1343d00e64e041439b1de4bcd80a Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 21 Mar 2008 16:40:17 +0000 Subject: [PATCH] Patch level : 4.0 914 Files correlati : ba7.exe cg2.exe Ricompilazione Demo : [ ] Commento : Aggiunto il file relations.ini da piazzare in recdesc che contiene le relazioni tr i file. Uyilizzato nel postino. git-svn-id: svn://10.65.10.50/trunk@16363 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/ba7100.cpp | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/ba/ba7100.cpp b/ba/ba7100.cpp index 4824c6682..28bee9ecd 100755 --- a/ba/ba7100.cpp +++ b/ba/ba7100.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -433,14 +434,29 @@ TFilter_expr::TFilter_expr(TAutomask& m, int logicnum, const char* expr) logicnum = LF_TABCOM; // Niente errori fatali, se possibile const TRectype rec(logicnum); - for (int i = 0; i < numvar(); i++) if (!rec.exist(varname(i))) - { - _error = 883; - TString msg; - msg.format(FR("Il campo %s non appartiene al file %d"), varname(i), logicnum); - print_error(msg); - break; - } + + for (int i = 0; i < numvar(); i++) + { + const TFixed_string name(varname(i)); + int num = logicnum; + bool ok = rec.exist(name); + + if (!ok) + { + const TFieldref f(name, 0); + int num = table2logic(f.id()); + const TRectype join(num); + ok = join.exist(f.name()); + } + if (!ok) + { + _error = 883; + TString msg; + msg.format(FR("Il campo %s non appartiene al file %d"), varname(i), logicnum); + print_error(msg); + break; + } + } } }