Kbase 14080: Example of positioning cursor in V6 or v7 field or variable
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
Example of positioning cursor in V6 or v7 field or variable
This example shows how to position the cursor on a text field,
placing it to the right of the characters that are already displayed
when the UPDATE is started.
This code is applicable more to Version 6 than Version 7. In
Version 7 there are cursor-position attributes that allow more
direct access to cursor placement. A v7 example follows this example.
/* v6 example */
DEF VAR i AS INT.
DEF VAR x AS CHAR INIT "Hello".
DEF VAR flag AS LOGICAL INIT YES.
UPDATE x WITH FRAME f EDITING:
IF flag THEN DO:
flag = NO.
DO i = 1 TO LENGTH(x):
APPLY KEYCODE("cursor-right").
END.
END.
READKEY.
APPLY LASTKEY.
END.
/* v7 v8 gui example */
def var x as char init "abc".
def frame y x.
display x with frame y.
on entry of x do:
apply "entry" to self.
x:auto-zap = no.
x:cursor-offset = 3.
return no-apply.
end.
enable x with frame y.
apply "entry" to x.
wait-for "GO" of frame y.
Progress Software Technical Support Note # 14080