How to toggle between two columns in a subfile

895 pts.
Tags:
AS/400 programming
AS/400 Subfiles
Subfile
I want to toggle between two columns in a subfile...I'm using following code to condition the fields...however when i display subfile none of the fields are displayed...is there anything else i need to take care of?

A            #PROCP         8A  O  6 22                    A  15                                  DSPATR(ND)          A            #ORDERP        8A  O  6 22                    A N15                                  DSPATR(ND)          

----------

C   If  cond = true

C  Eval *in15 = *on

C endif


Software/Hardware used:
AS400

Answer Wiki

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

Do you update and redisplay the subfile after you set *in15 to on?

Discuss This Question: 10  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
  • CharlieBrowne
    Sometimes it is easier to have two subfiles in the program and you build them at the same time. Everything being the same except that #PROCP is in subfile1 and #ORDERP is in subfile2. Then *IN15 just conditions which EXFMT to use.
    41,370 pointsBadges:
    report
  • Nutangujar
    yes, I do update the subfile after switching the indicator on
    895 pointsBadges:
    report
  • Nutangujar
    i actually have only one column different in both sfls ....defining new subfile may need a new set of variables and then bunch of move's do you think this is the only way?
    895 pointsBadges:
    report
  • TomLiotta
    Regardless of whether *IN15 is on or off, ND will be in effect at the field position your data is displayed. Tom
    125,585 pointsBadges:
    report
  • Nutangujar
    how can i toggle between 2 columns then in SFL?
    895 pointsBadges:
    report
  • TomLiotta
    AFAIK, you actually want to toggle between two subfiles -- the toggle will make one or the other subfile active. (And when I say you "want" to, I mean that that's the facility you need to look at. I'm pretty sure it's not what any of us would want to do in this circumstance!) I'm pretty sure that's what CharlieBrowne was getting at back in his first comment. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Exactly -- you make two subfiles identical except one has one field showing and the other as hidden and the other has the mirror image When you write records to the subfile you write to both You exfmt on the control for the first subfile, if use hits the function key for the change exfmt on second. Phil
    49,730 pointsBadges:
    report
  • BigKat
    You would have to read in every record in the subfile and update it with the new *IN15 value to have one subfile with the conditioned display.
    8,060 pointsBadges:
    report
  • Sloopy
    Let's not use two subfile. I do this sort of toggling all the time. In the case where you have two possible columns occupying the same space and with the same length, it's quite easy. Store both values in hidden fields in the subfile line. When the toggle is set one way, and the subfile is first filled, both these fields are filled, AND the displayable field is filled with the right value - first tim in, let's say #PROCP values. When the user presses the toggle function key, either you can just refresh the subfile and load the displayable field with #ORDERP data, or you can read through the subfile and copy the #ORDERP data from its hidden field into the displayable field. Storing both pieces of data in hidden fields means that when you read a specific subfile record, you have that data available to you in your program. Don't forget to change the heading in the subfile control format (or header format) to show the user which data is being displayed. Using this technique, you can do all sorts of things with a subfile, like having the sort of window left/right function you can see in the spool file display screen. Because you store ALL the data you want to display conditionally in hidden fields in the subfile record, you don't have to reload the subfile when the toggle is pressed. Regards, Sloopy
    2,195 pointsBadges:
    report
  • Nutangujar
    ok I used two mirror image subfiles which seems to be simple solution.. thanks, Nutan.
    895 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