Hello Brian,
On Fri, 22 Dec 2000 at 01:25:48 GMT -0500 (which was 10:25 PM
where I live) witnesses say Brian Clark typed:
> Why are you using two sets of quotes around the value? I've seen
> similar in some of the examples in the FAQ, I think.
> What's different about %SUBPATT="1" (or for that matter,
> %SUBPATT='1')?
> Am I missing something?
Excellent question.
There is no difference between single quotes and double quotes, it
just makes life easier to use a mix. Hopefully the reason for this
will become clear.
The quotes (single and double) are delimiters that indicate the
boundaries for arguments to macros. So =" or =' is the start of the
arguments, and a closing quote is the end.
When you have a macro that accepts arguments, the arguments can be
macros that need arguments. Confused? Perhaps an example is in
order. Suppose we want to use a regular expression to clean up the
subject line.
%Subject="some regexp"
Where "some regexp" is something like:
%SETPATTREGEXP=":(.*)"%REGEXPBLINDMATCH="%OFULLSUBJ"%SUBPATT="1"
Now if you were to literally replace that regular expression line into
the %Subject macro, how is TB to know that you want all of it?
According to the rules, if we use:
%Subject="%SETPATTREGEXP=":(.*)"%REGEXPBLINDMATCH="%OFULLSUBJ"%SUBPATT="1""
TB thinks that the subject field should be filled with the value:
%SETPATTREGEXP=
That's not what you wanted. One option around this is to double up
the inner quotation marks. That's what Stuart had done, so I followed
suit.
The other option is to replace either the inner or outer argument (not
both) delimiters with single quotes. So the macro looks like:
%Subject='%SETPATTREGEXP=":(.*)"%REGEXPBLINDMATCH="%OFULLSUBJ"%SUBPATT="1"'
Here, I replaced the outer quotes. So the %Subject macro has an
opening delimiter =' and therefore it looks for the closing delimiter '
Note that you can make this almost arbitrarily complicated, you just
keep adding quotes. So if you had a macro within a macro within a
macro that needed arguments, you'd need ', '', and '''. Phew.
This seems a bit confusing when written out. Try to work out what TB
sees, and ask any questions that may arise.
--
Thanks for writing,
Januk Aggarwal
Using The Bat! 1.48f
under Windows 98 4.10 Build 2222 A
--
--------------------------------------------------------------
View the TBUDL archive at http://tbudl.thebat.dutaint.com
To send a message to the list moderation team double click here:
<mailto:[EMAIL PROTECTED]>
To Unsubscribe from TBUDL, double click here and send the message:
<mailto:[EMAIL PROTECTED]>
--------------------------------------------------------------
You are subscribed as : [email protected]