This special property is used only for paged grids. The value of FILE-POS is the grid's record number that matches the current file position in the corresponding data file. It is used to simplify the paging logic in your program. FILE-POS computes the number of records that need to be read in order to find the record needed by the grid. The grid uses this value when generating MSG-PAGED-NEXT or MSG-PAGED-PREV events.
The FILE-POS value will often be either the last visible record in the grid or the first non-heading record visible. To illustrate, suppose that you have a four-line grid with no headings. When you are moving forward through the file, FILE-POS will usually be 4, matching the last record added to the grid. If the user clicks the Next Record button, the MSG-PAGED-NEXT event will indicate that only one READ NEXT is needed to retrieve the appropriate record. However, if the user clicks the Previous Record button, the MSG-PAGED-PREV event will indicate that four READ PREVIOUS statements are needed to get the desired record. In this case, FILE-POS will change to 1, indicating that only one READ PREVIOUS is needed to get another previous record while four READ NEXT statements are needed to get the next record.
In addition, FILE-POS has three special values that are level 78 data names defined in acugui.def. These values are listed below:
PAGED-AT-START | (value 2147418113) | The grid will not generate MSG-PAGED-PREV and MSG-PAGED-PREVPAGE events. |
PAGED-AT-END | (value 2147418114) | The grid will not generate MSG-PAGED-NEXT and MSG-PAGED-NEXTPAGE events.. |
PAGED-EMPTY | (value 2147418115) | MSG-PAGED-NEXT, MSG-PAGED-NEXTPAGE, MSG-PAGE-PREV, and MSG-PAGED-PREVPAGE are not generated. Since it is possible that other users will add records to the file (that could be seen by re-reading it), this value will still generate MSG-PAGED-FIRST and MSG-PAGED-LAST events. |
The grid automatically manages FILE-POS, using the following rules:
The automatic handling provided here will correctly handle grids whose data is coming from an indexed data file if you move the file's record pointer only in response to grid events (and only as required by those events). In cases in which you move the file's record pointer independent of a grid request, you will need to do one of the following:
Any of the techniques mentioned above will work. Note, however, that FILE-POS may be difficult to compute with the first technique because it is often hard to tell how far apart two records are in an indexed file.