Previous: Converting Modules into Units
Up: Converting Modules into Units
Previous Page: Converting Modules into Units
Next Page: Converting Attract Mode into Main Program
In converting each module to a unit, it is essential to check those units the module uses for any that are private to it, and which have initialization code. When the module was a free-standing program, this initialization code was executed automatically when the program was called. Now it must be called explicitly each time the Activity n routine is called.
A good way to do this is to modify the unit so the code its initialization used to run is now contained in an exported routine. The Activity n procedure must now call this new routine before doing anything else in its code, to preserve the order of execution.