Two questions - buttons persisting between calls and use of = sign

In this code -

on promptForReply(entryFunction, message, messageVariables, "", "", "", rememberedObjectName, "", "", "", messageVariableNames)
	set answer to ""
	set expandedMessage to message
	if entryFunction is "notify" then
		display dialog (expandedMessage)
	else if entryFunction is "boolean" then
		set question to display dialog expandedMessage buttons {"Yes", "No"} default button 2
		set answer to button returned of question
	end if
	return answer
end promptForReply
on notifyMessage(message, messageVariables, messageVariableNames, rememberedObjectName)
	promptForReply("notify", message, messageVariables, "", "", "", rememberedObjectName, "", "", "", messageVariableNames)
end notifyMessage
on yesMessage(message, default, messageVariables, messageVariableNames, rememberedObjectName)
	promptForReply("boolean", message, messageVariables, default, "", "", rememberedObjectName, "", "", "", messageVariableNames)
end yesMessage

notifyMessage(yesMessage("Hello", "", "", "", ""), "", "", "")

set answer to yesMessage("Hello", "", "", "", "")
notifyMessage(answer, "", "", "")

applescript tags added: ACB

When this is run, both (equivalent) forms of the invocation produce a dialog, with “Yes/No” buttons followed by a second dialog which also shows the same buttons. I wanted the second dialog to show no buttons - just display the answer. It is as if the buttons are not cleared between invocations of promptForReply. Is it that the buttons, having been set in the first invocation, remain set until explicitly altered.

Comments would be appreciated.

The second question is where can I read about the difference between -
a = b
and
set a to b

Model: Macbook Air
AppleScript: 2.2.3
Browser: Chrome
Operating System: Mac OS X (10.8)

I have found the answer to the second question - the statement
a = b
is comparing a to b, and the statement
set a to b
is setting the value of a to the value of b

Hi, aroundtuit. Welcome to MacScripter.

‘display dialog’ dialogs can have one, two, or three buttons, the default being two: “Cancel” and “OK” in the user’s preferred language. By default too, clicking the “Cancel” button generates a “User canceled.” error which stops the script and “OK” is a default button which responds to the return key.

The first ‘display dialog’ in your promptForReply() handler has no button parameters and therefore uses the defaults I’ve just described. So if you click anything other than the “Cancel” button in the second dialog to appear, the script will continue and execute all the other calls. You could try expanding that first ‘display dialog’ line to:

display dialog (expandedMessage) buttons {"OK"} default button 1 cancel button 1

This gives the dialog a single, default, “OK” button which acts like a “Cancel” button and stops the script when clicked.

That’s correct. There’s also .

copy b to a

. which sets a to a duplicate of the value of b, which is useful for some kinds of values.

By the way, these fora have [applescript] and [/applescript] tags to put round posted code so that it appears with a clickable link as in my examples above.

@Nigel Garvey
Thankyou for your reply, which answered my questions and helped me on my way.