Modify display file in runtime

15 pts.
Tags:
AS/400
RPGLE
I need to change field attribute in display file within runtime, is there any way to do that?

Answer Wiki

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

Hi,

You can condition the attributes with indicators, and change the indicators at run-time. Is this what you mean?

Regards,

Martin Gilbert.

Hi,
You can also define a “program to system” field for each filed you want to control. Then you can send the code to each field on your display.

The following example shows how to specify the DSPATR keyword with P-field usage:

|…+….1….+….2….+….3….+….4….+….5….+….6….+….7….+….8
A R RECORD
A FLD1 5A 2 6DSPATR(&PFLD1)
A FLD2 5A 2 6DSPATR(&PFLD2)
A PFLD1 1A P
A PFLD2 1A P
A
The field PFLD1 carries the attribute value to control FLD1. The name can be anything as long as the reference is correct. “Link”: the FLD1 attribute to the value in PFLD1
You can provide the value in the program to PFLD1. The value will affect the attribute of field1.
Check the DSPATR reference for the values. You control the “program to system” value and that controls the attributes of the field

Good Luck
Bob McAuliffe
PGMBOB

Discuss This Question: 4  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
  • SyriANgel
    is it possible to do so with Right - To - Left attribute 
    15 pointsBadges:
    report
  • TomLiotta

    'Right to Left' is not a display attribute, so it isn't optionable. It's a cursor-control (i.e., keyboard control) attribute. It is specified with the CHECK(RL) or CHECK(RLTB) keyword not with DSPATR(). The DDS manual tells you all of this.

    Tom

    125,585 pointsBadges:
    report
  • philpl1jb
    Perhaps you could have seperate records for right-to-left or seperate display files for right-to-Left
    49,950 pointsBadges:
    report
  • bvining

    Right to Left cursor control is very language and CCSID specific, and typically associated with a pre-defined set of users (working in those languages/environments).

    The "normal" way of handling this would be to have two *DSPFs -- one with left to right, the other right to left. The Left to Right users would have a library list where the Left to Right display file is found, the Right to Left users a library list where the Right to Left display file is found. This would also, though it would be up to you if you wanted to do it, enable translation of the *DSPF panels to the appropriate language of the user.

    Bruce Vining

    6,485 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