ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

What does INFDS really contain for Number of Subfile Records?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What does INFDS really contain for Number of Subfile Records?

    So I cannot seem to find an answer to this question anywhere, hopefully someone here will know.

    Here is an INFDS data structure for a display file.

    Code:
    dcl-ds ScreenInfo;
    sStatus *STATUS;
    // *** Open Area
    sFile char(10) pos(83);
    sLib char(10) pos(93);
    sNumLines int(5) pos(152);
    sNumPos int(5) pos(154);
    // *** I/O Area
    sFormat char(10) pos(261);
    CmdKey char(1) pos(369);
    sRow int(3) pos(370);
    sCol int(3) pos(371);
    sfRRN int(5) pos(376);
    sfTopLine int(5) pos(378);
    [COLOR=#c0392b]sfNumRecs int(5) pos(380);[/COLOR]
    swRow int(3) pos(382);
    swCol int(3) pos(383);
    sRtnCode char(2) pos(401);
    end-ds;
    Now, regarding that field sfNumRecs at position 380.
    Does that field contain the total number of records in the subfile, or the number of active records in the subfile?
    If I initialize a subfile with SFLINZ and SFLRNA, then display it, and the user enters a few lines of the subfile (for example, they type something in lines 1, 2, 3, and 5), then what will sfNumRecs have as a value?

  • #2
    Well according to this https://www.ibm.com/docs/en/i/7.4?to...-display-files it is updated whenever a PUT operation is performed - in other words when a record is added. But it is an easy enough thing to check. It also appears though that since this is a device-related value it includes the counts for ALL subfiles on the screen. So depending on what you want to do with it it may not be that helpful.

    Can you not simply maintain your own active count?

    Comment

    Working...
    X