Я сделал калькулятор, который должен работать, но не работает. Единственная часть, которая работает, - это дополнение. это мой код:applescript Калькулятор не работает
my Calculator()
on Calculator()
display dialog "Calculator" buttons {"Add", "Multiply", "Divide"}
if button returned of the result is "Add" then
display dialog "What plus What?" default answer ""
set a to (text returned of result)
if a is equal to "q" then
return
end if
display dialog "Next number" default answer ""
set b to (text returned of result)
set c to a + b
display dialog "The answer is " & c buttons {"Start Again", "Quit"}
if button returned of the result is "Quit" then
return
else
my Calculator()
end if
end if
if button returned of the result is "Multiply" then
display dialog "What times what?" default answer ""
set a to (text returned of result)
if a is equal to "q" then
return
end if
display dialog "Next number" default answer ""
set b to (text returned of result)
set c to a * b
display dialog "The answer is " & c buttons {"Start Again", "Quit"}
if button returned of the result is "Quit" then
return
else
my Calculator()
end if
end if
if button returned of the result is "Divide" then
display dialog "What divided by what?" default answer ""
set a to (text returned of result)
if a is equal to "q" then
return
end if
display dialog "Next number" default answer ""
set b to (text returned of result)
set c to a/b
display dialog "The answer is " & c buttons {"Start Again", "Quit"}
if button returned of the result is "Quit" then
return
else
my Calculator()
end if
end if
end Calculator
end
end
это код приложения. Прошу прощения, если это вопрос, но мне нужна помощь. Благодаря!
Спасибо, что установил ее. Извините, я отклонил изменение, я не заметил изменений – samrockw22
Добро пожаловать. –