Pages: 1
Macro in macro, Macro syntax problem
Hi to all!
I need your help about a problem with macro in macro.
The problem is this: in one of the layout, I need to insert the date in format in the subject.
So I think to use this macro:
%SUBJECT=" / %DATE="""%-
The result is

Subj: / dd/mm/yyyy
Text:" "

Can you help me?

Best regards,
TB starts reading from the first quotation mark to the second and considers that as the parameter for the %Subject= macro, then it goes on with your text and that shows up as:""

So you'd better try this:
%Subject=" / %Date=''"%-

I'm just a user of The Bat! I don't work for Ritlabs.
why not only using %ODATESHORT ?

and that all...

I have a small question:

How can I use some regex like in the subjet ?

%Subject="%SETPATTREGEXP="(?i-s)^BProduct :\s(.*)$|\z"%-%REGEXPBLINDMATCH="%text"%-'"
The reason not to use the DateShort macro is because that uses the system's country settings for the date. I don't know what your country settings dictate, but mine don't set a dot as separator.

The way to use regexp in your subjext is the same as the original question: Don't use the same quotation marks for both macros.
Your macro reads as: %Subject="%SETPATTREGEXP=" the second quotation mark sets the end of the %Subject macro. The rest of your regexp is inserted in the text body, TB doesn't care whether that text makes any sense or not.
So first you start with building a regexp that has the desied output and then you build a set of quotation marks around it that you don't use in the regexp itself. You can use pairs of ' or  " as quotation marks, but also things like #, _ or &.
I'm just a user of The Bat! I don't work for Ritlabs.
Pages: 1