Roll Keys with Subfiles
From: Robert Munday To: All
I require assistance with a subfile matter, and I'm turning to those of you who are more experienced. I have solved this problem with command keys, but I want to use the roll keys to perform the natural roll up/roll down function.
The subfile is a schedule grid with multiple horizontal window views and up to 999 vertical lines. The subfile is loaded at program initiation with all of the elements needed for the chosen display.
The window left and right function keys work normally; but if the user rolls up or down and then chooses to window sideways, the index places the display on the last value referenced by an Enter or Cmd function instead of the line displayed. If I'm positioned at line 1 and I roll down to view line 500, windowing sends me right back to line 1 since the roll keys currently do not affect the subfile record index.
I have also used the ROLLUP and ROLLDOWN keywords with indicators in the DDS, but this did not work for me.
How can I use the roll keys within this subfile to position the display at a chosen line, and then remain at that line as I window sideways?
From: Eric Hill To: Robert Munday
I think you need to use the SFLRCDNBR keyword on your DDS specs. (See 4.) This displays the page containing the number in the variable associated with the SFLRCDNBR keyword.
I think you need to use the SFLRCDNBR keyword on your DDS specs. (See Figure 4.) This displays the page containing the number in the variable associated with the SFLRCDNBR keyword.
Always make it a hidden field. The CURSOR parameter will place the cursor by the subfile entry that contains the value in RCDNBR.
From: Pete Hall To: Robert Munday
When I need to preserve the subfile position, I generally code something like 5.
When I need to preserve the subfile position, I generally code something like Figure 5.
The SFLCSR field is used on the SFILE line for the F-spec, as well as on the SFLRCDNBR keyword in the DDS. That way I have only one value to worry about when I want to position the subfile. The INFDS returns the lowest subfile record on the display the last time it was read. By storing the lowest subfile record immediately after the Execute Format (EXFMT) operation, I avoid problems that occur when other I/O to the display corrupts the value before I get around to using it.
After reloading the display, which positions SFLCSR to the last record in the subfile, I restore the value from SRCSFR only if there are currently enough records in the subfile to display the page which contains that record. (There may be fewer records now than there were when Enter or a function key was last hit.) The net result is that the display is always positioned, as closely as possible, to the same page that it was on before. You can take it one step further and save the actual display cursor position and restore that to the same coordinates too, if you need to.
Roll Keys with Subfiles
Figure 4 The SFLRCDNBR Keyword
... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 A RCDNBR 3S 0H SFLRCDNBR(CURSOR)
Roll Keys with Subfiles
Figure 5 Preserving the Subfile Position
... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 A R S1CTL SFLCTL(S1SFL) A TEXT('Subfile control') A* . . . A SFLCSR 4S 0H SFLRCDNBR ... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 FPRGOBJFMCF E WORKSTN F SFLCSRKSFILE S1SFL F KINFDS WSINF * . . . IWSINF DS I B 378 3790D@LSFR * . . . C EXFMTS1CTL C Z-ADDD@LSFR SRCSFR LOWEST SFL REC * C SRCSFR IFLT 1 FORCE 1 IF INVALID C Z-ADD1 SRCSFR C ENDIF >SRCSFR IFLT ONE * * . . . * C LODDSP BEGSR * * . . . LOAD THE SUBFILE C SFLCSR IFLT SRCSFR C Z-ADDSFLCSR SRCSFR C ENDIF >SFLCSR IFLT SRCSFR * C ENDSR ... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8
LATEST COMMENTS
MC Press Online