Brilliant! I wasn't having a problem with the same code but that's the answer. The problem is that
QDK is generating those curly braces.
I add a function and the code produced is:
define function <myfunction>
return <%i%>
end define
When I add a conditional statement, the code saved by QDK becomes:
define function <myfunction>
{
if ( %i% = 5 ) then msg <weird, huh?>
return <%i%>
}
end define
The braces can be removed from the code manually, but they will return next time you change that function's code in QDK. Add that to the bug list.