Sheerpower Logo
H.4  Program Segmentation using Include Directives

When your code base becomes very large, dividing it into smaller sections can greatly aid in code maintenance. The %include directive is designed for this purpose. In this example, we have a file named safe_common.spinc that contains the following code:

full_name$ = 'Sally Sue' tax_rate = 6.5 routine do_it print 'Doing the routine called '; _routine end routine
Here is the example of using the include file.
%include '@..\safe\safe_common' print 'The full name is: '; full_name$ do_it
Large business applications can easily contain hundreds of thousands of lines of code. These applications are greatly simplified by using many include directives. Typically, each include file contains all the variables and routines needed to perform a specific subtask.
Hide Description

    

       


      

Enter or modify the code below, and then click on RUN

Looking for the full power of Sheerpower?
Check out the Sheerpower website. Free to download. Free to use.
Wide screen