Kbase 12640: CHOOSE ROW and SPACE BAR Trapping spaces in a char field
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
CHOOSE ROW and SPACE BAR Trapping spaces in a char field
def var i as int.
repeat i = 30 to 35 :
display i keyfunction(i).
end.
message "enter a space bar or some other character".
readkey.
if keyfunction(lastkey) = " " then
display "you typed a space.".
else
display keyfunction(lastkey).
message "type another keystroke".
readkey.
if can-do(keyfunction(32),keyfunction(lastkey)) then do:
display "passed the".
display keyfunction(32).
display "test".
end.
if keyfunction(32) = " " then display "OK" with frame e.
CHOOSE ROW statement is specifically designed to have a
"record advance" behavior associated with the SPACE bar
and there isn't a way to change the CHOOSE ROW to trap that.
The CHOOSE statement itself is shorthand for what can be
accomplished with a combination of statements manipulating
the DOWN positioning of the cursor and the
COLOR DISPLAY MESSAGES
attribute of the fields where the cursor is positioned.
Use an EDITING block to monitor the user's
keystrokes (see p. 538 of Language Ref), and the BEGINS
function to locate the correct record.
Progress Software Technical Support Note # 12640