Hi
I finally got a grip of a bug which was initially very confusing. Consider this code:
When you press apply you expect to see the message "1" presented and that is exactly what happens.
Now say you want to try the code without the "$x := 1" so you comment that line out:
Now you'd expect to see the default value of $x presented ("0"). However the second message statement is never executed so there is no message presented. Apparently Kontakt can't properly handle empty if-statements whose condition is true (maybe this applies to while-loops as well). It seems that executing the body of an empty if-statement causes the execution of the whole callback to be silently aborted.
Normally one doesn't use empty bodies, but sometimes when you test things you comment out code and then this one is a real gotcha.
So I guess we now have two cases where a callback is silently aborted:
* Executing an empty if-body
* Assigning to a builtin variable
Nils
I finally got a grip of a bug which was initially very confusing. Consider this code:
Code:
on init
declare $x
message("")
if (1 = 1)
$x := 1
end if
message($x)
end on
Now say you want to try the code without the "$x := 1" so you comment that line out:
Code:
on init
declare $x
message("")
if (1 = 1)
{$x := 1} { <-- commented out }
end if
message($x)
end on
Normally one doesn't use empty bodies, but sometimes when you test things you comment out code and then this one is a real gotcha.
So I guess we now have two cases where a callback is silently aborted:
* Executing an empty if-body
* Assigning to a builtin variable
Nils