Every software has got a License Agreement. In this tutorial we will learn how can we check if the user has scroll down to the end of license agreement. This way we will give us a theoretical chance that the user has reeded our license before accepting it. Watch it, learn it, enjoy it!
Add to our Window one TextArea, one PushButton and one Timer control. In TextArea property Text put for example GNU GPL License Agreement. Now to the property Enabled of PushButton type false. You can do this by clicking on PushButton control and in Property Panel find and disable Enabled property.

In this part of tutorial we will create a Action in Timer control to check if the user has scroll to the end of License Agreement. If he has we will active the PushButton for next action. Double click on Timer1 control and use this code below:
1 2 3 4 5 6 | if TextArea1.ScrollPosition = 456 then PushButton1.Enabled = True Timer1.Enabled = False else PushButton1.Enabled = False end if |
How we know that 456 is the end of our TextArea.ScrollPosition? The License Agreement has got always the same length so we have easier task. We can check the end of scroll position in TextArea1 with this code (create a new PushButton and when you scroll to the end of TextArea1 click on it).
1 | msgBox = CStr(TextArea1.ScrollPosition) |
OK, but somebody can ask how can we get the end of text available in TextArea1 when we don’t know the length of string inside it. The answer is easy:
1 | msgBox = CStr(TextArea1.LineNumAtCharPos(TextArea1.Text.Len) + 2) |
Of course every code from this tutorial can be used in Windows, Linux and Mac OS version of REALbasic. I use Mac OS and I prefer it to show my tutorials. REALbasic is cross-platform and you can use your favourite system to create great applications in this IDE.