

// Script function: Choice menu

// 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




TagGroup GlobalSino, MyItems, EMChoiceItems

GlobalSino = DLGCreateDialog( "Choice menu", MyItems ) 
 
TagGroup EMChoice = DLGCreateChoice(EMChoiceItems, 2) // Default choice is 2.


For (Number i=0;i<=3;i++)
EMChoice.DLGAddChoiceItemEntry("choice "+i,i)
 
MyItems.DLGAddElement( DLGCreateLabel( "Please select a choice:" ) )    
 
MyItems.DLGAddElement( EMChoice ) 
 
if ( !Alloc( UIframe ).Init( GlobalSino ).Pose() ) exit (0) 
 
string SelfLabel       
 
Result( "Selected a choice entry/index: " + EMChoice.DLGGetValue() + "\n" )
 
if ( EMChoice.DLGGetNthLabel( EMChoice.DLGGetValue(), SelfLabel ) )
 
Result( "Selected a choice entry/label: " + SelfLabel + "\n" ) 
 
Result( "\n\n" )


// Comparison with the script without FOR command at: http://www.globalsino.com/EM/page2597_DLGCreateChoice.s