我可以想象兩種基本方法,雖然我確信還有其他幾種。
// 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)
祝你好運,
特里
我不完全清楚你是什麼意思,所有的變量返回空值。據我所知,只有ls_message將爲空。我想你可以寫一個小函數(類似於TSQL IsNull),你可以檢查空值並返回空字符串。通過這種方式,結果不會爲空。 – DARKinVADER