This code, handed over as a parameter, is executed; the result is entered in the program to be compiled. This allows the compilation of code that does not originate in a file and/or the evaluation of certain constants that are set only once during development time:
*!<[EXEC:
Select Snippet ;
From Code ;
WHere CodeID = "GetTemperature" ;
into Cursor ExecCode
Return ExecCode.Snippet
]>
In this example we assume that the table Code contains small code segments in a memo field called Snippet and that these code segments should be inserted in an AFP page. In contrast to the INCLUDE Command, this page will not be re-compiled after the modification in a table record. You should also make sure that the routines return identical content at each invocation. If contents differ, the AFP could in certain circumstances assume that the page has been modified and would thus call for a re-compilation every time the page is accessed. In essence, this applies to all code in .afpa.code.