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

PageListDelete

Removes a page at the specific index from the page list of the current window. This function will return an error if only one page is in the list. If the page is currently displayed, the next page will be displayed. If there is no next page, the previous page will be displayed.

Syntax

PageListDelete(INT index)

Index

Index to the page list (valid range 0 to list size minus 1)

Return Value

0 (zero) if the page is successfully removed, otherwise an error is returned.

Related Functions

PageListCount, PageListCurrent, PageListInfo, PageListDisplay

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

 

See Also

Page Functions

Published June 2018