Top Content Up
Prec

4.3 glocal

Next Skip

The TLMP concept introduce a tree like programming with a shared context. In the previous example, we are simply printing a line using printf. Now, imagine we want to send the line to another file, using a FILE handle. Normally, the loadfile component would have to be modified to carry this extra information, or we will have to use a global variable. With the glocal concept, no need for that.
<glocal>
	FILE *fout;
</glocal>
glocal.fout = fopen ("/tmp/output","w");
<call loadfile>("index",true);
	<f oneline>
		<call loadfile>(line,true);
			<f oneline>
				fprintf (glocal.fout,"oneline: %s\n",line);
			</f>
		</call>
	</f>
</call>

Using the glocal tag

Top Content Up
Prec

Next Skip
Table of content
One big HTML document