2

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

Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
Shaahin Ashayeri
  • 918
  • 2
  • 13
  • 30

1 Answers1

2

$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.

Eric Grange
  • 5,931
  • 1
  • 39
  • 61