[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: conditionel include

El Tue, Nov 30, 1999 at 07:13:37PM +0100, Jan Holler contaba:

><if foo
>#include 'test.wml'

Well, this will work... but not as you expected. The include will be
done in pass #1 but then pass #2 will ignotre it:


<if foo
#include 'test.wml'

Pass 1:

<if foo
(.... The code you have in 'test.wml' .....)

Pass 2:

if 'foo':

(... the code you have in 'test.wml' ....)

if not 'foo':


But the file will be included anyway. This can slow things down a
little, but the importante thing is the result O:-)

>or does one get "a conditional reading-and-including" of a
>file "only" e.g. via eperl?

'eperl' or 'm4' can support this.

I leave 'eperl' for a more experienced user, I can tell you how in

  m4_ifelse("foo", "true", m4_include(test.wml))

Anyway, take care of an important point. If you include a file in
pass2, pass3 or pass4, it will skip the prior passes, so if you use
this code, all the MH and ePerl code will be useless. 

><ose        xmanoel@bigfoot.com   (Vigo/Galicia/Espaņa)

Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com