Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Retrieve the Function Key Used on a Display File

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Retrieve the Function Key Used on a Display File

    I have been using this methodology for quite some time now, but what I have seemed to discover (please someone tell me if I am wrong) is that once the key is pressed, the field Fkey can only be cleared. I cannot seem to change it to some other value. For example
    clear Fkey
    works but
    eval key = @Pageup
    does not work. Does anyone know of a way (or tell me that what I am doing is wrong) to change the value of Fkey within a program. Second question. Within debug, is there a way to display the hex value of a field - as in Fkey? Thanks in advance

    Comment


    • #17
      Retrieve the Function Key Used on a Display File

      Is the FKey variable your INFDS AID field (Pos 369?). Sometimes as you read through the subfile, etc, it gets changed automatically. So, I save a value of it right after the EXFMT and only refer to that saved value. In debug add :X after. Eval myfield : x Chris

      Comment


      • #18
        Retrieve the Function Key Used on a Display File

        Ringer Thanks for the debug help. Your idea of saving the FKey variable (INFDS AID field Pos 369) is a simple and effective idea, but (isn't there always a but) I am attempting to change/enhance a monolith/giant/gargantuan etc. program, where if a certain condition exists AFTER pressing Enter on a screen, I need to display another window. Needless to say to come out of this window, I could be pressing F3, F12 etc. The logic no longer follows the correct path as the Fkey may no longer = Enter. Hence my wanting to have the ability to change Fkey to Enter. Alan

        Comment


        • #19
          Retrieve the Function Key Used on a Display File

          I am not sure if I understood your question properly. It appears you want to remember what Fkey was used to exit the main window and what was used to exit the one. Can't you use two different variables e.g. ExitMain and ExitWind and save the Fkey in one of them depending on which file you performed the EXSR on?

          Comment


          • #20
            Retrieve the Function Key Used on a Display File

            Sorry Hassan - unless someone can tell me otherwise the key that is pressed to come out of the main screen is Enter (Fkey = Enter), then if a certain condition is present another window/screen is displayed. To come out of this window/screen you have to press either, Enter/F3/F12 depending on what is wanted. Therefore Fkey now = Enter (in which case the rest of the logic is ok), F3 (Fkey = F3) or F12 (Fkey = F12). The last 2 instances, the rest of the logic is NOT okay as the rest of the logic depends upon Fkey = Enter. Hence my dilemma - I cant Eval Fkey = Enter Alan

            Comment


            • #21
              Retrieve the Function Key Used on a Display File

              There is a little known function (I last saw this used on a System/38) called VLDCMDKEY within DDS that will assign an indicator if any function key is pressed. If the assigned indicator is off, then ENTER has been pressed. Dave

              Comment


              • #22
                Retrieve the Function Key Used on a Display File

                Sorry David - I don't see how this is going to help. The rest of the logic after the new window/screen is looking for Fkey = Enter. If the window/screen is displayed and F3 or F12 is pressed to get out of the window/screen I still need the Fkey to be equal to what it was before the window/screen being displayed - namely Enter. If I'm misunderstanding what you are telling me, my apologies. Alan

                Comment


                • #23
                  Retrieve the Function Key Used on a Display File

                  Maybe I got you this time. Correct me if I am wrong. You want to force the value of Fkey to be ENTER so the rest of the logic may think that ENTER key was pressed. I would do the following. 1. Eval mykey with the value of Fkey after every EXFMT. 2. Change the code to check mykey instead of Fkey. 3. Eval the value of Fkey whenever you want to force the ENTER key.

                  Comment


                  • #24
                    Retrieve the Function Key Used on a Display File

                    hey Alan, there you go again, going on topic again. The manual says that changing feedback area results can cause unexpected results and is *discouraged*. Can you put the additional display record format in a separate WORKSTN file with its own INFDS data structure? rd

                    Comment


                    • #25
                      Retrieve the Function Key Used on a Display File

                      Maybe its time for a vacation. I have just given myself 1000 dope slaps, followed by a million lashes with a wet noodle. All this time I've been trying to use eval. Well I suddenly thought, why haven't I tried MOVE or MOVEL. Well MOVEL seems to work. I define a hold field in the d-specs D Hldfkey s like(Fkey) then in the c-specs AT the point where I see if the condition exists to display the window/screen I use C movel Fkey Hldfkey Then once I have finished with the window/screen display C movel Hldfkey Fkey and the logic goes onto the end Debug with eval Fkey:x shows that the value returns to what it was. I was feeling somewhat good about this, although a little stupid in not having thought of it before, when Ralph shows me what the manual says. God I need this week-end. Alan

                      Comment


                      • #26
                        Retrieve the Function Key Used on a Display File

                        And voila! here it is. Glad it's working now. rd

                        Comment


                        • #27
                          Retrieve the Function Key Used on a Display File

                          Hans, True enough and I applaud the INDDS implementation--long overdue. I've been using this techinque for, as you said, some 20+ years. But I've taken it a step further. I do not simply say "If Fkey=F3". Instead I implement something I demonstrated at COMMON back in oh 1987, I think. "Softcoded Function Keys". Where there is a routine that generates the Function key line "message" at the bottom of the display based on the assignment of the Fn keys in a database. In the program, the key action is softcoded and reacts based on what was assigned. This has to be done once and is more steps than just using "Fkey = F3, call mysubproc" but as you pointed out, if I need to change the action of F5 to Refresh and move the Update function to F7, I do that in the database/repository of function key assignments for that application. Too bad this kind of stuff can't be externalized, packaged and sold to people on this platform like the old "ProKey" product from RoseSoft (where I stole the idea from back then). If iSeries customers only bought third party software, we'd have so much more to offer.

                          Comment


                          • #28
                            Retrieve the Function Key Used on a Display File

                            Reason number 1: Ah... because it is a crazy idea. Reason number 2: Because you can already simulate it with the INDDS as Hans and many other suggtested: D INDDS DS D inF01 1N D inF02 1N ettc.

                            Comment


                            • #29
                              Retrieve the Function Key Used on a Display File

                              I've been using this technique for quite a while. In the example below, @keyEXIT is F3, @keyREFRESH is F5 and @keyCANCEL is F12. You can match whatever function key you want, starting with F1 @ *IN(130)
                              Code

                              Comment


                              • #30
                                Retrieve the Function Key Used on a Display File

                                Has IBM guaranteed that the display file function keys will always follow the *IN array, in those exact positions? If not, your applications could break the next time your upgrade OS/400. Good luck. Chris

                                Comment

                                Working...
                                X