Pages, PageCount
Pages is an array that gives you access to each page in a page frame without needing to know the page's name. PageCount tells you how many pages are in the page frame.
Usage |
pgfPageFrame.PageCount = nNumberOfPages nNumberOfPages = pgfPageFrame.PageCount pagPage = pgfPageFrame.Pages[ nPageNumber ] |
Example |
* Count the total number of controls in a PageFrame * Assume the PageFrame is PageFrame1 on the current form LOCAL nPage, nTotalControls nTotalControls=0 FOR nPage = 1 TO ThisForm.PageFrame1.PageCount nTotalControls = nTotalControls + ; ThisForm.PageFrame1.Pages[nPage].ControlCount ENDFOR * In VFP 5 and later, you can do this with a FOR EACH loop * instead. Note that the code in the loop is more readable. LOCAL nTotalControls, oPage nTotalControls=0 FOR EACH oPage IN ThisForm.PageFrame1.Pages nTotalControls = nTotalControls + oPage.ControlCount ENDFOR |
See Also |