// Script function: Input dialogs for "Magic Guess"

// Unless named starting with GlobalSino, EM, My, Self, the function commands are defined 
//by Gatan DM, please see at link: http://www.globalsino.com/EM/page2597.html

// Beginning of choice setup
TagGroup GlobalSinoDialog, EMItems
GlobalSinoDialog = DLGCreateDialog( "Magic Guess", EMItems )
TagGroup MyOptions = DLGCreateRadioList( 1947) // "1947" here says the default selection is the one with the same number below.

MyOptions.DLGAddRadioItem( "1947", 1947 )
MyOptions.DLGAddRadioItem( "1967", 1967 ) 
MyOptions.DLGAddRadioItem( "1987", 1987)
 
EMItems.DLGAddElement( DLGCreateLabel( "Please guess a number:" ) )       

EMItems.DLGAddElement( MyOptions )       

if ( !Alloc( UIframe ).Init( GlobalSinoDialog ).Pose() ) exit (0)

// End of choice setup

number EMInputGuess = MyOptions.DLGGetValue()

number EMMagic = 1967 // correct number


if(EMInputGuess == EMMagic) 
Result ("\nYour are correct! \n")
else 
Result ("\nSorry, you're wrong! \n")







