Hello Sandor,

Historians believe that Mon, 9 Jul 2001 at 23:02 GMT +0200 was when,
Sandor SZAKACS-VASS [SSV] typed the following:

>> Think of the arguments to any macro as a mini template. It is
>> completely independant from the rest of your overall template. That
>> means that if you want to use a regexp search, you must do the
>> search inside the delimiters of the %IF macro.

SSV> You answer my new questions before I could ask them:) I'd no idea why my
SSV> %SETPATTREGEXP...
SSV> %REGEXPBLINDMATCH...
SSV> %IF:"%SUBPATT...
SSV> (which I used beacause it's more readable) didn't work...

Yes, it would be nice if we could create user defined global
variables.  But I'm guessing this would have to wait until TB has a
proper scripting language.  For now you can put your regexp in a quick
template and just use a %QINCLUDE in your %IF macro.

Also, the %- macro was introduced to help with the readibility issue.
It has two functions depending on where in the template it exists.  At
the end of a line, the %- macro suppresses the line-break.  In the
middle of a line, it is just a place holder.

Let me know if you want an example.

SSV> But I still have a question for today. I noticed that some (let's
SSV> say higher level or general) macros like %LANGUAGE or %SINGLERE
SSV> can't be used inside of a quick template included by an %IF
SSV> macro.

As far as I know, it should work.  You might want to check that there
are no typos anywhere.  Also, inside the quick template, the nesting
levels are reset, so you start from level 1 again.

SSV> So this won't work:
SSV> %IF:"string1"="string2":"%QINCLUDE=""English""":"%QUINCLUDE=""French"""

You have one spelling mistake: %QUINCLUDE=""French"" should be
                               %QINCLUDE=""French""

SSV> where English is a quick template which contains %LANGUAGE="AM"

That looks right to me.

SSV> But this will:
SSV> 
%IF:"string1"="string2":"%LANGUAGE=""AM""%QINCLUDE=""English""":"%QUINCLUDE=""French"""

Hmm, the other one should work.  What happens if you add some text to
your English Quick Template?  Does it show up in either case?

SSV> Is there a general rule which macros can't be included this way
SSV> and in which situation (and why)?

As far as I know, you're not doing anything forbidden.

SSV> Wait a minute... Is this because what you said about macro as a
SSV> mini-template? But if so, why did it screw up the result instead of being
SSV> silenty ignored (or having effect only inside of the included template)?

I think I over-simplified the situation.  The stuff about
mini-templates is really only applicable to the regular expression
macros and other content altering macros.  The option setting macros
are treated differently.

SSV> Well, I already am a 3-days-user:))

You're doing great.

-- 
Thanks for writing,
 Januk Aggarwal

Using The Bat! 1.53bis under Windows 98 4.10 Build 2222  A

Is it OK to use the AM radio after noon?

-- 
______________________________________________________
Archives   : <http://tbudl.thebat.dutaint.com>
Moderators : <mailto:[EMAIL PROTECTED]>
TBTech List: <mailto:[EMAIL PROTECTED]>
Unsubscribe: <mailto:[EMAIL PROTECTED]>

You are subscribed as : [email protected]


Reply via email to