User Tools

Site Tools


howtos:toolcoding:user_interaction

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
howtos:toolcoding:user_interaction [2010/09/18 17:54]
marcus.williams
howtos:toolcoding:user_interaction [2013/09/12 20:16] (current)
deryn.crockett [Menu Command]
Line 25: Line 25:
 listen ("What percentage change do you want to allow? {0..}[75] ",​$percentChangeImm) listen ("What percentage change do you want to allow? {0..}[75] ",​$percentChangeImm)
 if $percentChangeImm == ""​ if $percentChangeImm == ""​
-  ​$percentChangeImm = "​75.0"​ + $percentChangeImm = "​75.0"​ 
-  percentChangeImm[] = create (; data=75.0)+ percentChangeImm[] = create (; data=75.0)
 else else
-  ​percentChangeImm[] = create (; data=$percentChangeImm)+ percentChangeImm[] = create (; data=$percentChangeImm)
 endif endif
 </​code>​ </​code>​
Line 55: Line 55:
 The syntax of the menu command is: The syntax of the menu command is:
  
-menu (prompt, numItems, item1, ..., itemN, $choices[])  ​+menu (prompt, numItems, item1, ..., itemN, $choices[]; {defaultChoice={1..N},​ {oneChoice={true,​false}}})  ​
  
 where where
Line 66: Line 66:
  
 //​$choices[]//​ is an array of boolean TOOL variables. After the user has entered their menu choices, this array will contain true if the menu item has been selected and false if it has not. This array must be at least as big as the number of items in the menu. //​$choices[]//​ is an array of boolean TOOL variables. After the user has entered their menu choices, this array will contain true if the menu item has been selected and false if it has not. This array must be at least as big as the number of items in the menu.
 +
 +//​defaultChoice//​ is an integer that specifies which option is the default selection if the user does not make a selection.
 +
 +//​oneChoice//​ is an optional boolean flag that forces the user to choose only one option.
 +
 +//​**note:​**//​ If both //​defaultChoice//​ and //​oneChoice//​ are used, defaultChoice must precede oneChoice.
  
 === Example === === Example ===
howtos/toolcoding/user_interaction.1284832452.txt.gz · Last modified: 2010/09/18 17:54 by marcus.williams