Code: Select all
function a x, y
# return something
end a
function b x, y
# return something
end b
function c x, y
# return something
end c
function getFunction n, m
if someCondition then
return "a"
else if someOtherCondition then
return "b"
else
return "c"
end if
end getFunction
on mouseup
# some code to get n, m, x, and y ...
put getFunction(n, m) into myFunction
do "put" && myFunction & "(x, y) into someVariable"
# do something with someVariable
end mouseup
Code: Select all
command a
answer "a"
end a
command b
answer "b"
end b
command aorb
answer question "a or b?" with "a" or "b"
call it
end aorb
Code: Select all
function a x, y
return "x"
end a
function b x, y
return "y"
end b
command aorb
answer question "a or b?" with "a" or "b"
call it(1, 2)
answer it
end aorb
Thanks in advance,
Dale