{"identifier":9950,"topic":"HyperTalk basics","name":"Writing message handlers","text":"When you write a handler for a message, you specify a sequence of statements for HyperCard to run. Each message handler has the following form, with the italicized words as placeholders: <br><br>\n\n <code><pre>on <i>messageName<\/i>\n   <i>statements<\/i>\nend <i>messageName<\/i>\n<\/pre><\/code> When it runs the message handler, HyperCard sends each line of the handler as a message itself (so handlers can call other handlers). <br>\n<br>\n<b>Important<\/b>: The message name does <i>not<\/i> have to be one of HyperCard\u2019s built-in system messages or commands. <br><br>\n\n For example, if you wanted a new command called<code> doubleBeep <\/code>that would beep twice, you would write a handler for it as follows: <br><br>\n\n <code><pre>on doubleBeep\n  beep\n  beep\nend doubleBeep<\/pre><\/code> <br>\n","related":{"20813":null,"6658":"Handling messages","26982":"on","8578":"The message-passing order","10721":"Using parameter variables","5306":"What are messages?"},"examples":"","demo":"<br><br>\n\n ","debug":{"9":["When you write a han"],"10":["Important: The messa"]}}