STRSDA – F4 processing

440 pts.
Tags:
AS/400
AS/400 Subfiles
STRSDA
In a display screen I have the following fields - Member ID and book ID. When I take F4 on Member id I want the Member details window to open and when I take F4 on Book id, the book details window should be opened. Now my question is: I have declared F4 function key as CF in the display file & the separate subfile windows have been coded. But how will AS/400 know that I am taking F4 on Member Id or Book ID? Which key word can I use to trigger this? Can you please answer this?

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Your best choice is probably to use an INFDS() for your display file and check the 'Cursor location (line and position)'.   The cursor position field is two bytes. The first byte is a hex value that tells what line of the display the cursor was on. If your MemberID field is on line 5 of the display and the cursor is on that field, then the first byte will contain x'05'. If the MemberID starts in column 10 and goes to column 15, then the second byte will contain a value from x'0A' through x'0F'. The position of BookID can be derived in the same way.   You might build an array of hex values that list the starting and ending values for each field. When you retrieve the value from the INFDS(), you can search the array to see if the value is within the starting and ending positions of any field. (If you only have two fields on the display, you can just code the hex values into a couple IF statements. An array really isn't needed.)   There are File APIs that you can use to retrieve display field definitions. If you used the APIs, it wouldn't be necessary to generate your array by hand and compile it into your program. But using the APIs for this is probably too much effort.   Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    The record level keywor RTNCSRLOC will return the display file field name.  
    RTNCSRLOC(&SREC &SFLD &SPOS)
    
    SPOS 4S 0H
    SFLD 10A  H
    SREC 10A  H
    
    49,510 pointsBadges:
    report
  • TomLiotta
    Yes, RTNCSRLOC() -- best choice. That's the way to go. I was sure there was a keyword, but couldn't find what it was for some reason. I was even sure I had an example and couldn't find it either. Tom
    125,585 pointsBadges:
    report
  • juslikdat1
    Thanks a lot. I tried using RTNCSRLOC. Its working.
    440 pointsBadges:
    report
  • philpl1jb
    Thanks for the feedback.
    49,510 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following