Subfiles – RtnCsrLoc

pts.
Tags:
Application development
RPGLE
I understand that you can use the RtnCsrLoc to retrieve the cursor position and field name. However, is there a way to force values into RtnCsrLoc? This would be best stated with an example. I have 2 fields on my subfile control record. The first Payment type and the second credit card number. My problem is this, if the user types in a value of "CHG" in the Payment type field and does not enter a credit card number, I want to be able to force the field name SCCCD# into SFLFld. The program would some how calculate the field position of that field and position the cursor appropriately. Is there a way to do this or am I dreaming?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Why don’t you hust use a DSPATR(PC) (position cursor) on the credit card number field. I woudl use an indicator to condition the keyword and if the CHG is entered and the credit card# is blank, set on the indicator and redisplay the screen. The cursor will be positioned to the credit card number field. Make sure you set the indicator off when no error exists.

RTNCSRLOC is used to show what field the cursor was on when you press an F-key, etc. This is handy when you allow users to prompt for code values in certain fields. When they posiiton the cursor to a field and press an F-key you would have a routine that looks at the field name returned and call the appropriate prompt program.

Discuss This Question:  

 
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

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