ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Enter VS CHECK(ER)

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

  • Enter VS CHECK(ER)

    Anyway the RGPLE program can now if the enter it's cause by the CHECK(ER)?

  • #2
    Re: Enter VS CHECK(ER)

    No, There isn't a way to differentiate. Below I put a small program below that shows it. Whether actually pressing enter or letting CHECK(ER) simulate enter on field exit.

    Code:
    A                                      DSPSIZ(24 80 *DS3)
    A                                      INDARA            
    A          R FMT1                                        
    A                                      CF02(02 'ret')    
    A                                      CF03(03 'Exit')   
    A            FIELD          9N 0B  7 19                  
    A                                      CHECK(ER)
    Code:
     ctl-opt option(*srcstmt:*nodebugio);         
                                                  
     dcl-f test93d workstn infds( infoDS );       
                                                  
     dcl-ds infoDS;                               
       keyPressed char(1) pos(369);               
     end-ds;                                      
                                                  
    * Function keys.                              
     dcl-c ENTER const(X'F1');                    
                                                  
    * Named indicators.                           
     dcl-s IndicatorPtr pointer inz(%addr(*in));  
     dcl-ds Inds based(IndicatorPtr);             
       f3 ind pos(03);                            
     end-ds;                                      
                                                  
     dow f3 = *off;          
       exfmt fmt1;                         
       if f3 = *on;                        
         iter;                             
       endif;                              
                                           
       if keyPressed = ENTER;              
         dsply ('Enter was pressed');      
       endif;                              
                                           
     enddo;   
    
     *inlr = *on; 
     return;
    What is it that you are wanting to do if you could differentiate? Maybe there is another way to do it.

    Comment


    • #3
      Re: Enter VS CHECK(ER)

      If the value in the field it's "A" it should activate another field on the screen, else saves on the file.

      Comment


      • #4
        Re: Enter VS CHECK(ER)

        If the value is 'A' and CHECK(ER) results in being passed to the program, it implies that the field on the screen is only one character wide. In that case, there should be no way for the user to press -Enter- unless the user didn't type anything into the field. And in that case, there would be no change in the field that would be signaled.

        Does the record have the CHANGE() keyword specified?
        Last edited by tomliotta; November 19, 2014, 06:46 PM. Reason: Fix HTML code
        Tom

        There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

        Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

        Comment


        • #5
          Re: Enter VS CHECK(ER)

          No.
          But im using now.

          Thanks
          Last edited by Thunder; November 19, 2014, 08:46 AM.

          Comment

          Working...
          X