Difference between revisions of "SET KEY TO"

From Recital Documentation Wiki
Jump to: navigation, search
(Products)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=SET KEY TO=
 
 
 
==Class==
 
Keyboard Events
 
 
  
 
==Purpose==
 
==Purpose==
Line 15: Line 9:
  
 
==See Also==
 
==See Also==
SET KEY, CTRL(), @...MENU, @...GET, KEYBOARD
+
[[@...GET]], [[@...MENU]], [[@...SAY]], [[APPEND]], [[CHANGE]], [[CREATE SCREEN]], [[CTRL()]], [[EDIT]], [[FMT()]], [[Function Keys]], [[INSERT]], [[KEYBOARD]], [[MODIFY SCREEN]], [[QUERY]], [[READ]], [[SET FORMAT]], [[SET KEY]]
  
  
Line 21: Line 15:
 
The SET KEY TO <expN> command is used in custom screen formats to map a menu option to a function or control key.
 
The SET KEY TO <expN> command is used in custom screen formats to map a menu option to a function or control key.
  
A screen format file, which is activated with the SET FORMAT TO <.fmt filename> command, can contain a form definition using @…SAY...GET commands, and can also contain a menu definition using @...MENU commands.  When the form is activated by one of the full screen forms based commands APPEND, CHANGE, EDIT, INSERT, QUERY or READ, the form is displayed on the screen and data input mode is entered.  If the [MENUBAR] key is pressed, then any @…MENU commands which have been defined in the screen format file are activated.  You can then specify the SET KEY TO <expN> command as the command on the @...MENU command.
+
A screen format file, which is activated with the SET FORMAT TO <.fmt filename> command, can contain a form definition using @...SAY...GET commands, and can also contain a menu definition using @...MENU commands.  When the form is activated by one of the full screen forms based commands APPEND, CHANGE, EDIT, INSERT, QUERY or READ, the form is displayed on the screen and data input mode is entered.  If the [MENUBAR] key is pressed, then any @...MENU commands which have been defined in the screen format file are activated.  You can then specify the SET KEY TO <expN> command as the command on the @...MENU command.
  
 
If you issue the SET KEY TO -1 command, activated from a menu selection, the menu will be exited.  The CTRL() function is often used with the SET KEY TO command.  The Screen Painter, initiated with the CREATE SCREEN command, allows menu items to be built into forms.
 
If you issue the SET KEY TO -1 command, activated from a menu selection, the menu will be exited.  The CTRL() function is often used with the SET KEY TO command.  The Screen Painter, initiated with the CREATE SCREEN command, allows menu items to be built into forms.
  
NOTE: It is important to distinguish this command from the following command (SET KEY <expN> TO <procedure name>), which has a different purpose.  An alternative to the SET KEY command is to use the KEYBOARD command.
+
NOTE: It is important to distinguish this command from the [[SET KEY|SET KEY <expN> TO <procedure name>]] command, which has a different purpose.  An alternative to the SET KEY command is to use the KEYBOARD command.
  
  
 
==Example==
 
==Example==
<pre>
+
<code lang="recital">
 
// Dataentry.fmt
 
// Dataentry.fmt
 
@0,0 say  "Next"
 
@0,0 say  "Next"
 
@0,0 menu "Next";
 
@0,0 menu "Next";
command "set key to ctrl(’n’)"
+
  command "set key to ctrl(’n’)"
 
@0,5 say  "Prev"
 
@0,5 say  "Prev"
 
@0,5 menu "Prev";
 
@0,5 menu "Prev";
command "set key to ctrl(’r’)"
+
  command "set key to ctrl(’r’)"
 
// The form would now be defined
 
// The form would now be defined
 
return
 
return
Line 42: Line 36:
 
use patrons index events, dates, names
 
use patrons index events, dates, names
 
set format to dataentry
 
set format to dataentry
change</pre>
+
change</code>
  
  
 
==Products==
 
==Products==
Recital Mirage Server, Recital Terminal Developer
+
Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
[[Category:Set_Commands]]
+
[[Category:Set_Commands|KEY TO]]
 +
[[Category:Keyboard Events]]
 +
[[Category:Keyboard Events Set Commands]]

Latest revision as of 16:12, 23 November 2009

Purpose

Map a menu option to a control or function key in a form


Syntax

SET KEY TO <expN>


See Also

@...GET, @...MENU, @...SAY, APPEND, CHANGE, CREATE SCREEN, CTRL(), EDIT, FMT(), Function Keys, INSERT, KEYBOARD, MODIFY SCREEN, QUERY, READ, SET FORMAT, SET KEY


Description

The SET KEY TO <expN> command is used in custom screen formats to map a menu option to a function or control key.

A screen format file, which is activated with the SET FORMAT TO <.fmt filename> command, can contain a form definition using @...SAY...GET commands, and can also contain a menu definition using @...MENU commands. When the form is activated by one of the full screen forms based commands APPEND, CHANGE, EDIT, INSERT, QUERY or READ, the form is displayed on the screen and data input mode is entered. If the [MENUBAR] key is pressed, then any @...MENU commands which have been defined in the screen format file are activated. You can then specify the SET KEY TO <expN> command as the command on the @...MENU command.

If you issue the SET KEY TO -1 command, activated from a menu selection, the menu will be exited. The CTRL() function is often used with the SET KEY TO command. The Screen Painter, initiated with the CREATE SCREEN command, allows menu items to be built into forms.

NOTE: It is important to distinguish this command from the SET KEY <expN> TO <procedure name> command, which has a different purpose. An alternative to the SET KEY command is to use the KEYBOARD command.


Example

// Dataentry.fmt
@0,0 say  "Next"
@0,0 menu "Next";
  command "set key to ctrl(’n’)"
@0,5 say  "Prev"
@0,5 menu "Prev";
  command "set key to ctrl(’r’)"
// The form would now be defined
return
 
use patrons index events, dates, names
set format to dataentry
change


Products

Recital