EndPrgm
"14" is the code for Exact/Approx. "1", "2" and "3" are the codes for Auto, Exact and Approximate,
respectively. This program works, but you can't really identify tell from the displayed menu which item
is which. A solution to this problem is to use extra Item commands, just as labels. With this solution, the
program now looks like
custom1()
Prgm
custom
title "Modes"
item "Set Auto:"
item "setmode(""14"",""1"")"
item "Set Exact:"
item "setmode(""14"",""2"")"
item "Set Approx:"
item "setmode(""14"",""3"")"
endcustm
custmon
EndPrgm
This program will create a menu for function key F1 that looks like this:
1:Set Auto:
2:setmode("14","1")
3:Set Exact:
4:setmode("14","2")
5:Set Approx:
6:setmode("14","3")
There are a few problems with this method. First, it makes the menu twice as long as it really needs to
be. Second, it is an awkward user interface, because the user's natural inclination is to press [1] for
Auto mode, while it is really key [2] that needs to be pressed.
These objections can be overcome by using both codes and strings in the Item arguments. Use the
"14" code to shorten strings, but use the strings themselves for Auto, Exact and Approximate:
custom1()
Prgm
custom
title "Modes"
item "setmode(""14"",""Auto"")"
item "setmode(""14"",""Exact"")"
item "setmode(""14"",""Approximate"")"
endcustm
custmon
EndPrgm
This program makes a menu that looks like this:
7 - 27