Home
Page
About
ToolBook
ToolBook
Tips
ToolBook
Projects
ToolBook
Links
Guest
Book


What to do when page or background is full in reader level
Everybody knows what to do when page is full in author level:
 move some objects from page to background, delete some objects and so on 
 - it depends of application.
But what to do when your page is full in reader level?
For example:
You have a page with two fields: list of articles and text of current article. 
When you choose an article in the list the text in second field changes.
So content of your page is not constant.
        myPage = text of textLine (selectedTextLines of field "List") of field "List"
        richtext of field "Article" = richtext or recordField "Article" of page myPage of book "Articles.tbk"
We used this method in several projects because editor can work with database
 in another book and not to worry about interface.
We checked the largest article and if there was no overflow of the page
 we thought that everything is OK.
But once we found that percentFreeSpace of page never restored!
So if you change text of field several times and then restore original text
 percentFreeSpace will be less then before.
At first we don't notice it because there was no error message
 but the text of field is cut.
So we need to restore original state of page.
I see three ways to do it.
1. The simplest way to restore original state of your book is to go to another book and to return.
                sysLockScreen = true
                myPage = name of this page
                myBook = this book
                go page "Temp" of book "temp.tbk"
                go page myPage of myBook
                sysLockScreen = false
The problem is that not only percentFreeSpace is restored
 but all properties of all objects. Only system variables don't change.
So you need to store all changed information in system variables and restore it after returning.
This method is good only for very simple applications.

2. The second way is to create a new page that looks like original page.
When percentFreeSpace of original page is extremely low you can create a new page with same name
 then copy all objects from original page to new page and then remove original page.
So you'll have a free page again.

3. The third way is the same as previous but you don't need to copy objects from old page to new.
You can show page with changing text in another viewer.
It must look like as you use one page.
So you need a page with only text field and may be with background picture
 corresponding to picture under this viewer.

Back to Tips Menu