PageListCount
- Last UpdatedJul 18, 2023
- 1 minute read
Gets number of pages in the page list of the current window.
See the Citect.ini parameter [Page]MaxList.
Syntax
PageListCount()
Return Value
Number of pages in the list
Related Functions
PageListCurrent, PageListInfo, PageListDisplay, PageListDelete
Example
INT count;
INT index;
INT error;
STRING PageName;
// While 4 entries will be added to page history, only 3 unique pages will be added
to page list
PageDisplay(Page1);
PageDisplay(Page2);
PageDisplay(Page1);
PageDisplay(Page3);
// iterate the pages in the list
count=PageListCount() //count=3
PageName=PageListInfo(0,0); //PageName=Page1
PageName=PageListInfo(1,0); //PageName=Page2
PageName=PageListInfo(2,0); //PageName=Page3
index=PageListCurrent(); //index=2,as Page3 is currently displayed
pageName=PageListInfo(index,0); //PageName=Page3
error-PageListDisplay(1); //recall Page2, error=0
index=PageListCurrent(); //index=1, as current index is moved as part of the recall
PageName=PageInfo(0); //PageName=Page2 as it becomes the current page
error=PageListDelete(index); //remove current page, i.e. Page2, error=0
PageName=PageInfo(0); //PageName=Page3, next page in the list is displayed
index=PageListCurrent(); //index=1, current index is not changed while the list is
reduced
count=PageListCount(); //count=2, only 2 pages left in the list