// Script function: WHILE statement with input dialogs

// 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( "Number selection", 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 select a number:" ) )       

EMItems.DLGAddElement( MyOptions )       

if ( !Alloc( UIframe ).Init( GlobalSinoDialog ).Pose() ) exit (0)

// End of choice setup

number EMInputGuess = MyOptions.DLGGetValue()

// WHILE statement is below

while(EMInputGuess>1966 && EMInputGuess<1968) 
{
EMInputGuess--;
Result (EMInputGuess + "\n")
}
Result ("Done! \n\n")








