Difference between revisions of "MENU TO"

From Recital Documentation Wiki
Jump to: navigation, search
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=MENU TO=
 
 
 
==Class==
 
Menus
 
 
 
 
==Purpose==
 
==Purpose==
 
Return a number according to the menu item chosen
 
Return a number according to the menu item chosen
Line 15: Line 8:
  
 
==See Also==
 
==See Also==
[[@...MENU]], [[MENU AT]], [[MENU COMMAND]], [[MENU FIELDS]], [[MENU FILES]], [[MENU FORMAT]], [[MENU QUERY]], [[MENU SCOPE]], [[COL()]], [[READVAR()]], [[ROW()]]
+
[[@...MENU]], [[COL()]], [[MENU AT]], [[MENU COMMAND]], [[MENU FIELDS]], [[MENU FILES]], [[MENU FORMAT]], [[MENU QUERY]], [[MENU SCOPE]], [[READVAR()]], [[ROW()]]
  
  
Line 33: Line 26:
 
<code lang="recital">
 
<code lang="recital">
 
@10,10 prompt "edit";
 
@10,10 prompt "edit";
message "edit a record."
+
  message "edit a record."
 
@11,10 prompt "append";
 
@11,10 prompt "append";
message "add a record."
+
  message "add a record."
 
@12,10 prompt "delete";
 
@12,10 prompt "delete";
message "delete a record."
+
  message "delete a record."
 
menu to choice
 
menu to choice
 
do case
 
do case
 
   case choice=1
 
   case choice=1
    do editfunc()
+
      do editfunc()
 
   case choice=2
 
   case choice=2
    do appendfunc()
+
      do appendfunc()
 
   case choice=3
 
   case choice=3
    do deletefunc()
+
      do deletefunc()
 
   otherwise
 
   otherwise
    dialog box "No choice."
+
      dialog box "No choice."
 
endcase
 
endcase
 
</code>
 
</code>
Line 53: Line 46:
  
 
==Products==
 
==Products==
Recital Mirage Server, Recital Terminal Developer
+
Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
 +
[[Category:Menus]]
 +
[[Category:Menus Commands]]

Latest revision as of 14:47, 12 November 2009

Purpose

Return a number according to the menu item chosen


Syntax

MENU TO <memvar>


See Also

@...MENU, COL(), MENU AT, MENU COMMAND, MENU FIELDS, MENU FILES, MENU FORMAT, MENU QUERY, MENU SCOPE, READVAR(), ROW()


Description

The MENU TO <memvar> command returns a number from 1 to n, according to the menu item selected, and zero if [ABANDON] was pressed. The companion command is @<expN>,<expN> PROMPT "item" MESSAGE "text".

The READVAR() function may be used to return the current <memvar>.

The MENU TO <memvar> command starts at the <memvar> position within the range of 1 and the number of @…MENU items defined in the menu.

The COL() and ROW() function may be used to return the coordinates of the current MENU TO <memvar>.

These commands are supported for compatibility with other products. It is far better to use @…MENU…COMMAND for this purpose.


Example

@10,10 prompt "edit";
  message "edit a record."
@11,10 prompt "append";
  message "add a record."
@12,10 prompt "delete";
  message "delete a record."
menu to choice
do case
  case choice=1
      do editfunc()
  case choice=2
      do appendfunc()
  case choice=3
      do deletefunc()
  otherwise
      dialog box "No choice."
endcase


Products

Recital