× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



In reading this thread, I see a recurring theme of mapping the AID byte
values to the actual key pressed (e.g., KEY_F3 --> x'33'). Being able to
unbind the user's function request from the actual key pressed is exactly
why I started using the AID byte method in the first place. How may folks
here have to deal with software developed on
various platforms with differing standards for the function keys? IIRC, that
mixing of standards was what spawned this thread in the first place.

In my /Copy module for AID byte constants, I can code the function key
assignments based on whatever standards are being employed at a customer
site (e.g. S/34: F7=Exit, S/38: F1=Exit, AS/400: F3=Exit) and then in the
program just test for the "user's requested function" not the "function
key". This way I can install my software and have it match whatever standard
is being used without having to modify the RPG code or DDS CA??/CF??
assignments.

Some code snippets as an example:

AS/400 standard uses:
     D cf_Exit       C                   Const(x'33')
     D cf_DoIt       C                   Const(x'F1')

S/38 standard uses:
     D cf_Exit       C                   Const(x'31')
     D cf_DoIt       C                   Const(x'F1')

S/34-36 standard uses:
     D cf_Exit       C                   Const(x'37')
     D cf_DoIt       C                   Const(x'F1')


C                   Select
C                   When      UserRequest = cf_Exit
C                   Eval      PgmAction   = pa_Exit

C                         When      UserRequest = cf_DoIt
C                         Exsr  EdtData
C                         If        Not ErrorFound
C                         Eval      PgmAction   = pa_Update
C                   EndIf

As you can see from these code fragments all I'm concerned with is that the
user requested to <EXIT> the program or to <PROCESS INPUT> not which key was
pressed. For me, this ability to "soft-code" the function key assignments is
THE reason for using the AID byte method.

Regards,

Brian



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.