Changed If syntax¶
What is new - 8.1¶
The If syntax was changed in v8.0 to allow for more flexible statements. This change caused a potential for errors in existing functions.
The change is adjusted quite easily. Incorrect syntax will be detected via Check Function Syntax.
If you have an If statement followed by an else if, the else and if must be on the same line, where the if could previously be on the line following the else.
This syntax works in both older versions and in v8.1.
if ({f53.LANGUAGE} = "0") then
return "Invoice"
else
if({f53.LANGUAGE} = "1") then
return "Invoice"
end
end
This syntax worked in older versions, but no longer works in v8.1.
if ({f53.LANGUAGE} = "0") then
return "Invoice"
else if({f53.LANGUAGE} = "1") then
return "Invoice"
end
end
This intermediate form also works in v8.1.
if ({f53.LANGUAGE} = "0") then
return "Invoice"
else if({f53.LANGUAGE} = "1") then
return "Invoice"
end