Table of Contents
Before we start writing programs, we will first have some theory. Below you see the (c++)- structure of hk_classes. There are classes that handle the contact to the database (see the left side of the graphic), while others handle the interaction with the user (we have already seen the hk_visible class in the previous section).
All data-sensitive objects are of type hk_dsvisible (or its child hk_dsdatavisible). hk_dsvisible inherits from hk_visible. The most important method of hk_dsvisible is datasource(). This method returns a class of type hk_datasource, representing the whole datasource (either a table or a query)
Figure 3.3. hk_datasource methods
returns the name of the datasource
moves the row selector (row cursor) to 'rownumber'
returns the row number of the current row
returns the total number of existing rows
returns an hk_column object of the column with the name 'name'
The following example shows how to move between rows in a datasource. For this, create a button in the form and set a datasource. Add the script to the "On click"-action.
How to get a specific hk_column object can be seen in the following example. For what you can do with this object, please see the next chapter.