In DWScript documentation we can see "{$F 'filename'}", but I don't understand what it means. Is it possible to describe It?

有帮助吗?

解决方案

$F is a bit like $I in that it includes source from another file. The difference is that where $I will include the other file "verbatim" without any changes (and thus that file is expected to be Pascal source), $F will include it after filtering the file.

The filtering mechanism is rather arbitrary, as basically you attach a filter component to the compiler that will take a string as input and return a filtered string as output. So you can think of filters as an open pre-processing mechanism.

An example of filter is the HTML filter that introduces support for a php-like syntax, but where the language is Pascal rather than php (you can see an example in this article or in the DWScript Web Server demo, look in the Demos/Data/www folder), where a $F can f.i. be used to include a CSS file inline in the output.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top