когда я предоставляю строку stknummer = "* VU-NR: -93.10xxxxxxxx_2-12-2011 *" для этой функции:
whileprintingrecords;
shared stringvar tstnummer;
shared stringvar stknummer;
local stringvar tst;
local stringvar stk;
local stringvar bc;
tst := tstnummer;
stk := stknummer;
//why is this not evaluated?
tst := Replace (tstnummer,":" ,"_" );
tst := Replace (tstnummer,"." ,"_" );
tst := Replace (tstnummer,"=" ,"_" );
tst := Replace (tstnummer,"/" ,"_" );
tst := Replace (tstnummer,"\" ,"_" );
tst := Replace (tstnummer,"?" ,"_" );
tst := Replace (tstnummer,"#" ,"_" );
tst := Replace (tstnummer,"." ,"_" );
tst := Replace (tstnummer,"*" ,"_" );
tst := Replace (tstnummer,"|" ,"_" );
tst := Replace (tstnummer,"<" ,"_" );
tst := Replace (tstnummer,">" ,"_" );
tst := Replace (tstnummer," " ,"-" );
//and this neither?
stk := Replace (stknummer,":" ,"_" );
stk := Replace (stknummer,"." ,"_" );
stk := Replace (stknummer,"=" ,"_" );
stk := Replace (stknummer,"/" ,"_" );
stk := Replace (stknummer,"\" ,"_" );
stk := Replace (stknummer,"?" ,"_" );
stk := Replace (stknummer,"#" ,"_" );
stk := Replace (stknummer,"." ,"_" );
stk := Replace (stknummer,"*" ,"_" );
stk := Replace (stknummer,"|" ,"_" );
stk := Replace (stknummer,"<" ,"_" );
stk := Replace (stknummer,">" ,"_" );
stk := Replace (stknummer," " ,"-" );
//select file output format
if {?barcode_type} = true
then (if trim(stk) =""
then
bc:= "*" + tst + "_" + totext(dateValue({@signdate})) + "*"
else
(
bc:= "*" + stk + "_" + totext(dateValue({@signdate})) + "*");;)
else bc := "*" + tst + "_" + totext(dateValue({@signdate})) + "*"
В результате замены не выполняются (то есть: is isвсе еще там)
когда я помещаю Replace (stk, ":", "_") в нижнюю функцию, как:
//select file output format
if {?barcode_type} = true
then (if trim(stk) =""
then
bc:= "*" + tst + "_" + totext(dateValue({@signdate})) + "*"
else
(
bc:= "*" + Replace (stk, ":", "_") + "_" + totext(dateValue({@signdate})) + "*");;)
else bc := "*" + tst + "_" + totext(dateValue({@signdate})) + "*"
Замена сделана правильно.
Почему замены не сделаны в первом примере?
Я хорошо вставил все замены в функцию, но это не слишком элегантно ...
Спасибо