Open in AppleScript Editor
global multiply_factor
on run
--Define Multiply_Factor
set multiply_factor to 64
--Use it in the math_problem subroutine
set the_answer to math_problem(16, 32)
return the_answer
end run
--This subroutine uses the multiply_factor variable even though we didn't pass it the multiply_factor variable during the run statement.
on math_problem(x, y)
set new_x to x * multiply_factor
set new_y to y * multiply_factor
set final_result to new_x + new_y
return final_result
end math_problem
0 comments:
Post a Comment