我今天刚开始使用applescript,听说过子程序。所以我决定编写一个小测试程序,它接受一个数字,将其加 9,减 27,除以 3,然后返回结果。只有它不返回结果;它会返回一个StackOverFlow
错误。什么是 StackOverFlow 错误?
程序编译正确,不知道哪里出了问题。就像我说的,我对 AppleScript很陌生。这是我正在运行的代码:
calculate_result(text returned of (display dialog "Enter a number:" default answer ""))
on calculate_result(this_result)
set this_result to this_result + 9
set this_result to this_result - 27
set this_result to this_result / 3
return calculate_result(this_result)
end calculate_result