Many files are interdependent of each other. AFP identifies these interdependencies by attaching file extensions to the complete existing file name. This lets you assign separate code files containing procedures and class definitions to both .afp files and to .afpa files. You can set up a code file for shop.afpa by attaching the extension .code. Hence, the complete name of the code file will be shop.afpa.code rather than shop.code. This convention lets you avoid conflicting names as the code file for shop.afp will be shop.afp.code thus distinguishing itself from the application file.
This concept is used throughout AFP 3.0. You can therefore deposit more detailed particulars of the individual pages in a configuration file for the benefit of the compiler. That page will have the extension .config. Consequently, for shop.afp the complete name would be shop.afp.config. We will discuss this configuration in more detail below.
You may accommodate procedures, functions and class definitions in this code file. There are strict rules for this, in contrast to FoxPro. All procedures must start with PROCEDURE and end with ENDPROC. Short forms like PROC or terminating a procedure with RETURN is not valid. AFP will not compile theses files correctly. The same goes for functions, which have to be embedded between FUNCTION and ENDFUNCTION, and for class definitions, which are checked for DEFINE CLASS and ENDDEFINE. Procedure and function names must not use underscores as these are used in AFP 3.0 as internal separators.
Procedures, functions and classes that are defined in .afpa.code are available in all pages and in the application itself. Procedures, functions and classes that were defined in the code file of a page (.afp.code) are only available in that particular page.