Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How detect if ENTER pressed in a display file? 2

Status
Not open for further replies.

jbcsg

Programmer
Nov 18, 2004
2
GB
Hello
A while back, someone gave me the following code (RPG3), but I cannot get it to work, so perhaps I didn't get the correct code.
ISCNDS DS
I 369 369 #ENTER

* Enter Pressed
C #ENTER WHEQ *ON

I cannot find "SCNDS" in any IBM manual - anyone know what that is and how to make this code work?

Thanks,
Bob
 
Bob,

The data structure should be placed on the F spec for the display file with the keyword INFDS:

Code:
 FWND070    CF   E             WORKSTN  INFDS( DSPD )                  
 F                                      SFILE( WND070A   : SFLRRN     )

Replace my DSPD with your SCNDS and you should be set. A further note. I always use a externally defined data structure. That way I don't have to remember the field positions:

Code:
 D DSPD          E DS

HTH,
MdnghtPgmr
 
Do as shown below instead
Code:
  fMyScreen    cf   e             workstn INFDS(ScnDS)

  d ScnDS           ds                                
   * Attention Indicator Byte
  d  PressKey             369    369

  d EnterKey        c                   const(x'F1')
  d RollUp          c                   const(x'F5')                          
  d RollDown        c                   const(x'F4')                          

       select;
       when PressKey = EnterKey;  // Enter Key pressed




 
MdnghtPgmr,
Thanks for info - should have realised this position (369) was from INFDS - what an idiot! Guess I just got hung up on thinking SCNDS was some special data structure.

Mercury2,
Thanks also - mighty useful to know these key presses are all detected at 369. Appreciate the code in RPG4 as well.

Thanks again to both of you!
Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top