I needed a few hours to find out why a (lengthy) handler
gave me wrong results. I couldn't believe it.
If you have a handler with one or more parameters
then to call this handler WITHOUT parameters is, with LC,
NOT the same as a call with empty parameters:
---> LC treats *missing* params as zero !!!! <---
Make a new stack, 1 button, 1 field. Script the button:
Code: Select all
on mouseUp
put empty into fld 1
-- variant 1: Call the handler without parameter
checkIt --> yields true true
-- variant 2: Call the handler with an empty parameter
put empty into y
checkIt y --> yields true false
end mouseUp
on checkIt x
put cr & (x is empty) && (x is "0") after fld 1
end checkit
HC on an emulated MacPlus yields for both variants "true false" what is logically correct, IMHO.
Is there a "List of Warnings" about such things?
Knowing the above "feature" had saved me a lot of time.