Kbase P105515: How to set default value on CHOOSE statement using an array variable?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
GOAL:
How to set default value on CHOOSE statement using an array variable?
GOAL:
How to indicate a default selection for a CHOOSE statement?
GOAL:
how to change default selection focus on a CHOOSE statement?
FIX:
It is necessary to create a character variable to hold the corresponding keystroke for the desired default selection. The variable must be set before executing the CHOOSE statement containing the KEYS option.
/*The following code will set the focus to the third member of the array*/
DEFINE VARIABLE c-valor AS CHARACTER EXTENT 3 INIT
[1,2,3] NO-UNDO.
DEFINE VARIABLE savekey AS CHARACTER NO-UNDO.
FORM c-valor[1]
c-valor[2]
c-valor[3]
WITH NO-LABELS NO-BOX ROW 10 CENTERED FRAME f-a.
DISPLAY c-valor WITH FRAME f-a.
savekey = c-valor[3].
CHOOSE FIELD c-valor KEYS savekey WITH FRAME f-a.