Quiting Classic Applet

: Hello All,
: This is my last step to complete my script.
: I am having trouble assigning a Quit command to a Dialog Director
: button. The Applet wiil quit, but I get a message that the
: variable Language was undefined.
: Is there a way to quit in a clean way?
: Please see my code below.
: Thank you in advance,
You can use “tell me to quit” and the applet will quit or use “error number -128” Jean-Baptiste LE STANG

: You can use “tell me to quit” and the applet will quit *
: or use “error number -128” Jean-Baptiste LE STANG *

1. Use the layout/format suggested by the dd documentation. The whole thing looks simpler and is easier to work with.
2. You don’t need to tell the applet to quit. If you have no further code at the top level which could be invoked your applet will quit because it has nothing else to do - you only trap for “if d’s item 1”.
3. Before you uncomment the last line you must, obviously, have a routine for ‘doNext’ or whatever you want to call it.

set choices to {"English", "French", "Italian", "German", "Spanish", "Japanese"}
set d to dd auto dialog {size:{390, 240}, contents:[¬
	{class:push button, bounds:[320, 210, 380, 230], name:"Next"},¬
	{class:push button, bounds:[240, 210, 300, 230], name:"Cancel"}, ¬
	{class:radio group, bounds:[10, 45, 130, 61], button offset:[120, 50], max down:3, contents:choices},¬
	{class:static text, bounds:[10, 10, 250, 26], contents:"Choose a language:"}]} with grayscale
set Language to choices's item (d's item 3)'s text 1 thru 2
--if d's item 1 then doNext(Language)

Andreas