ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

AutoRecognise Keyboard inputs

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

  • AutoRecognise Keyboard inputs

    Hi all,

    I have a display file and i am searching for a perticular string in it.

    I dont want to press enter, if i type SAT it has display all the name starting with SAT without pressing enter. if type the continuation i,e SATI it has to display name starting with SATI.

    Here i want to recognise when the keyboard input is given without pressing enter. Any idea
    Thanx
    satish
    Anyone who has never made mistake has never tried anything new.

  • #2
    Re: AutoRecognise Keyboard inputs

    Hi Satish,

    I am not sure if there is any API which can recognize the entered value in screen before the user press enter or any other key.


    If your requirement is a prompt for the input field, where you can select any of the chioces for the field, it could be done.

    Comment


    • #3
      Re: AutoRecognise Keyboard inputs

      Yep, that's a tricky one. You may need to get away from using a display file altogether and use of some of the dynamic screen management API's but even then I am not sure if it is possible. Screen management API's are considerably more complex to use than a simple display file as well.

      I like the idea though... let us know if you figure out how to get it working...

      Comment


      • #4
        Re: AutoRecognise Keyboard inputs

        Why is the enter key broken?
        Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

        Comment


        • #5
          Re: AutoRecognise Keyboard inputs

          Originally posted by soup_dog View Post
          Yep, that's a tricky one. You may need to get away from using a display file altogether and use of some of the dynamic screen management API's but even then I am not sure if it is possible. Screen management API's are considerably more complex to use than a simple display file as well.

          I like the idea though... let us know if you figure out how to get it working...
          even using DSM APIs the program has to regain control in order to do anything, which means an input operation (F key, Enter, etc.)
          I'm not anti-social, I just don't like people -Tommy Holden

          Comment


          • #6
            Re: AutoRecognise Keyboard inputs

            A one character input field with ER (Automatic Record Advance) set on might do the trick with some finageling. You could take the single input and concat it to the end of the display field. Not sure how you would do delete/backspace though If there is only one input field you might be able to hide it or something and just have the screen update after the entry. Maybe use overlay somehow to keep the screen from flashing? I don't know, just throwing out some ideas.
            Goodbye

            Comment


            • #7
              Re: AutoRecognise Keyboard inputs

              The theory is good, but in practice, it's hopeless.

              As an example:
              On this site, go to advanced search, and search for somebody name. One normally has finished typing the complete name before any results are returned. Same Internet Explorer... and that only checks previous sites that you've visited.

              To do it, you would might need to use something like INVITE on the DSPF. But that slows things down (IMO).

              Think also, you gonna have to build a result set (or just get the first row) for every character. On a file with 100k or more recs?
              Last edited by kitvb1; October 28, 2009, 05:22 PM.
              Regards

              Kit
              http://www.ecofitonline.com
              DeskfIT - ChangefIT - XrefIT
              ___________________________________
              There are only 3 kinds of people -
              Those that can count and those that can't.

              Comment


              • #8
                Re: AutoRecognise Keyboard inputs

                If anybody have the source code for this. It will be helpful for me..
                Thanx
                satish
                Anyone who has never made mistake has never tried anything new.

                Comment


                • #9
                  Re: AutoRecognise Keyboard inputs

                  In DDS for the field give

                  Automatic record advance . . . . . . ER Y (In Select Keying Options)

                  If your length of field is 4 then as soon as you enter four charactes it will read. if you want to enter 3 characters then give space and enter remaining 3 charactes.

                  This will read with out pressing Enter key in screen.

                  Comment


                  • #10
                    Re: AutoRecognise Keyboard inputs

                    Originally posted by bharathi_mech4 View Post
                    In DDS for the field give

                    Automatic record advance . . . . . . ER Y (In Select Keying Options)

                    If your length of field is 4 then as soon as you enter four charactes it will read. if you want to enter 3 characters then give space and enter remaining 3 charactes.

                    This will read with out pressing Enter key in screen.

                    Hi bharathi,

                    I dont want to type upto the end of the filed. If the field length is 20, then i cannot type the letters at the end of the fieid.
                    Thanx
                    satish
                    Anyone who has never made mistake has never tried anything new.

                    Comment


                    • #11
                      Re: AutoRecognise Keyboard inputs

                      Sounds like you want AJAX functionality for a 5250 display.

                      I don't think there is an OnKeyUp event one can listen to from a 5250.

                      Comment


                      • #12
                        Re: AutoRecognise Keyboard inputs

                        This might not work the way you want it too, I'm not sure any RPG program can do exactly what you want, but you can play around with this if you like:

                        Display File:
                        Code:
                        A                                      DSPSIZ(24 80 *DS3)             
                        A          R SCREEN01                                                 
                        A                                      CA03(03 'EXIT')                
                        A                                      CA05(05 'BACKSPACE')           
                        A                                  3  2'20 Character Display Field:'  
                        A            DISPLAYFLD    20   O  3 30DSPATR(UL)                     
                        A            INPUTFLD       1A  I 21  3DSPATR(ND)                     
                        A                                      CHECK(ER)                      
                        A                                 23  2'F3=Exit'                      
                        A                                 23 12'F5=Backspace'

                        RPG
                        Code:
                        FTEST1KEYD CF   E             WORKSTN                               
                        D DISPLAYFLD      DS            20                                  
                        D ARRAY                          1    DIM(20) OVERLAY(DISPLAYFLD:1) 
                        D INDEX           S              2  0                               
                         /FREE                                                              
                           DOW NOT *IN03;                                                   
                             EXFMT SCREEN01;                                                
                             IF NOT *IN03;                                                  
                               IF *IN05 AND INDEX > 0;                                      
                                 ARRAY(INDEX) = ' ';                                        
                                 INDEX -= 1;                                                
                               ELSE;                                                        
                                 IF INDEX < 20;                                             
                                   INDEX += 1;                                              
                                   ARRAY(INDEX) = INPUTFLD;                                 
                                 ENDIF;                                                     
                               ENDIF;                                                       
                             ENDIF;                                                         
                           ENDDO;                                                           
                           RETURN; 
                         /END-FREE
                        It's clumsy code and can easily be tripped. I'm not intercepting any special keys like enter so they just show as spaces in the field. You would either need a command key or intercept the enter key somehow (I have no clue how to do that, but I wish you luck).
                        Goodbye

                        Comment


                        • #13
                          Re: AutoRecognise Keyboard inputs

                          Originally posted by satish View Post
                          Hi all,

                          I have a display file and i am searching for a perticular string in it.

                          I dont want to press enter, if i type SAT it has display all the name starting with SAT without pressing enter. if type the continuation i,e SATI it has to display name starting with SATI.

                          Here i want to recognize when the keyboard input is given without pressing enter. Any idea
                          What you are asking for is basically impossible in any context that would be meaningful to the end-user. 5250s are a block mode device. Only a very limited number of keystrokes cause control to be retruned to the server and once there your program has to react and return control to the device. Ajax and a browser are the only simple way to get what you want.

                          I wasted many many hours some years ago trying to make all this happen using the various techniques floated here and a few more using IBM internal interfaces - and it never did work - it can't. If you want to see the closest you can get to doing this look at COBOL's support for program described display files - which is why I was working on this. It was designed to emulate the functionality in PC COBOL dialects like Micro Focus and failed in absolute terms because 5250s just don't work that way.

                          Trust me - don't waste your time.

                          Jon P.

                          Comment


                          • #14
                            Re: AutoRecognise Keyboard inputs

                            I always wondered how IBM accomplished this in OfficeVision. Hmmm.....
                            Jonas Temple
                            Got FROG?
                            Got Tadpole? No, because it's not done yet! Stay tuned....

                            01010111 01100001 01110011 01110011 01110101 01110000 00100000 01100100 01101111 01100111 00111111

                            Comment


                            • #15
                              Re: AutoRecognise Keyboard inputs

                              Originally posted by jtemple View Post
                              I always wondered how IBM accomplished this in OfficeVision. Hmmm.....
                              Good point - I guess I should have been more specific - I meant in a standard 5250.

                              I cannot for the life of me recall what the feature is that OV needs to do it almost like a PC.

                              I'll check with a friend or three see if thir memory is any better.

                              Jon P.

                              Comment

                              Working...
                              X