Cicode Programming Reference > Cicode Function Categories > Page Functions > PageListCurrent

PageListCurrent

Gets Index of the current page in the page list of current window.

Syntax

PageListCurrent()

Return Value

List index (0 to list size -1), or -1 if unable to get index

Related Functions

PageListCount, 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-PageListRecall(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

 

See Also

Page Functions

Published June 2018