Pages: 1
RSS
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 dd.mm.yyyy format in the subject.
So I think to use this macro:
%SUBJECT=" / %DATE="dd.mm.yyyy""%-
The result is

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

Can you help me?

Best regards,
               Brunnen.Naz
 
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:
dd.mm.yyyy""


So you'd better try this:
%Subject=" / %Date='dd.mm.yyyy'"%-

__________________________________
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