[Migrated content. Thread originally posted on 16 February 2006]
How do I test if a function key (F1-F8) has been pressed?
Tia
Ian Warner
Hi Ian,
declare:
* in an non gui env:
01 fun pic s9(005) comp-1.
88 f1 value 1.
88 f2 value 2.
88 f3 value 3.
88 f4 value 4.
88 f5 value 5.
88 f6 value 6.
88 f7 value 7.
88 f8 value 8.
* in an gui env:
01 fun pic s9(005) comp-1
is special-names crt status.
88 f1 value 1.
88 f2 value 2.
88 f3 value 3.
88 f4 value 4.
88 f5 value 5.
88 f6 value 6.
88 f7 value 7.
88 f8 value 8.
...
* in an non gui env:
accept myfield on exception fun continue
end-accept
if (f1)
perform do-f1
end-if
...
* in gui env:
accept handle-myfield on exception continue
end-accept
if (f1)
perform do-f1
end-if
*
NOTE: be careful if exception value if you set something like
KEYSTROKE ...
in cblconfi config file. (refer to documentation)
hope this helps, bye Giovanni
[Migrated content. Thread originally posted on 16 February 2006]
How do I test if a function key (F1-F8) has been pressed?
Tia
Ian Warner
Actually, the CRT STATUS special names code works in
both a gui and a non-gui environment. At least it does here.
We use the same variable, defined the same way in both our GUI and our text-based programs.
And it doesn't matter which format of the ACCEPT you use.