我可以描绘出两种基本方法,尽管我确信还有更多。
// insert between assignment and concatenation
IF IsNull (ls_element1) THEN ls_element1 = ""
IF IsNull (ls_element2) THEN ls_element2 = ""
IF IsNull (ls_element3) THEN ls_element3 = ""
或者
//create a function that mimics the if() DataWindow function in PowerScript
function string f_if (boolean ab_Condition, string as_TrueResult, string as_FalseResult)
IF ab_Condition THEN
RETURN as_TrueResult
ELSE
RETURN as_FalseResult
END IF
并将您的串联更改为
ls_message = f_if (IsNull (ls_element1), "", ls_element1) + &
f_if (IsNull (ls_element2), "", ls_element2) + &
f_if (IsNull (ls_element3), "", ls_element3)
祝你好运,
特里