Writing the Code and Link methods
The next step is to write code and link the methods as a function to the table. Depending on the complexity of the code, we can leave it in one function, or use Natural Language Programming and Encapsulation to create multiple functions that explain our intention.
We will first focus on one function and explain how to structure the code.
Creating the cleaning entries
Since our function contains an iteration through a room record set, the Main function is a single description of the iteration.
In the following function, we again describe the business logic while programming the loop. Both the functions that we call have a meaningful name:
WITH Room DO
IF FINDSET THEN BEGIN...