{"identifier":30026,"topic":"Commands","name":"answer","text":"<code><pre>answer <i>text<\/i>\nanswer <i>text<\/i> with <i>reply1<\/i><u>\n<\/u>answer <i>text<\/i> with <i>reply1<\/i> or <i>reply2<\/i> \nanswer <i>text<\/i> with <i>reply1<\/i> or <i>reply2<\/i> \u00ac\n                        or <i>reply3<\/i><\/pre><\/code> <br><br>\n\n <code>answer file <i>text<\/i> <\/code>[<code>of type <i>fileType<\/i><\/code> ] <br><br>\n\n <code><pre>answer program <i>text<\/i> [of type \u00ac\n<i>                      processType<\/i> ]<\/pre><\/code> The form<code> answer <i>text<\/i> <\/code> displays a <b>question<\/b> (<i><code>text<\/i><\/code> ) in a dialog box. The dialog box contains from one to three buttons, each representing a different  reply the user can select. <br>\n<br>\nIf you use<code> answer <\/code>without specifying any replies, HyperTalk displays an OK button as the default. Otherwise, the last reply you specify becomes the default button. (Pressing Enter or Return chooses the default button.)<code> Answer <\/code>returns the name of the button clicked by the user in the local variable<code> it<\/code>. <br><br>\n\n <code>Answer <\/code>automatically sizes the dialog box to fit the size of the text (up to 13 lines). The total length of the text cannot exceed 254 characters. <br>\n","related":{"31208":"ask","103709":"programs"},"examples":"answer \"The file has been saved.\"\nanswer \"Really delete this file?\" with \"Yes\" or \"No\"\nanswer \"Sort by:\" with \"Cancel\" or \"Number\" or \"Name\"\n\nanswer file \"Choose a file to load:\"\nanswer file \"Where is the stack you want?\" of type stack\n\nanswer file \"Where is the program you want to open?\" of type application\nif the result is \"Cancel\" then ...\n\nanswer program \"What program do you want to switch to?\"\nanswer program \"\" -- prompts with \"Choose a program to link to:\"","demo":"on mouseUp\n   <b>answer<\/b> file \"Please select a file:\" of type stack OR text\n   if it is not empty then\n     put it into fullPathName\n     put fullPathToFileName(fullPathName) into fileName -- see below\n     <b>answer<\/b> \"You selected file: \u201c\" & fileName & \"\u201d\" & return & return &\u00ac\n     \"The full path for the file is:\" & return & \"\u201c\" & fullPathName & \"\u201d\"\n   end if\n end mouseUp\n <br><br>\n\n function fullPathToFileName fullPathName\n   put the itemDelimiter into savedDelimiter\n   set itemDelimiter to \":\"\n   put last item of fullPathName into fileName\n   set itemDelimiter to savedDelimiter\n   return fileName\n end fullPathToFileName\n ","debug":{"9":["answer text\ranswer t"],"10":["If you use answer wi"]}}