Using the 4DVAR tag, you can insert the result of a 4D Function in a semi-dynamic web page served by 4D. The only real restriction is that that function has to 'make sense' within the context of the process that sends the page out.
For example, the following HTML comment will add a selected record number into the HTML page.
<!--4dvar string(selected record number([MyTable]))-->
This example demonstrates that 4DVAR is not limited to displaying field and variable values, but can also accept the results returned by 4D functions in certain cases as well.