Hello Roelof,

Friday, July 23, 2004, 8:15:42 PM, you wrote:

JH>> smartpants  me  wanted to try to adjust a neat macro I found in the library, and
JH>> as  usual,  I  can't  get it to work. Without TBUDL I wouldn't use TB, because I
JH>> couldn't use it the way, it's supposed to!

> Next time add something like
> http://www.silverstones.com/thebat/Library.html#greet+all+recipients
> to your message, so your recipient doesn't have to guess what you
> picked.

you're right and I apologize!


JH>> What's wrong here?   I changed the last section.

> And with pasting in your message you inserted some spaces, I've been
> searching quite a bit before I realized where the additional spaces
> came from. I couldn't find them in your greeting line.

JH>>   %REM="
JH>> %REM="

> See what I mean?

aye,  next  time  I will just put it into a webpage, then I can even mark what I
actually changed in a better way.

JH>> %_GAR_To="%_GAR_To%-Guten %IF:%TIME<10:Morgen:Tag%-
JH>> %IF:%ABTOGENDER=2:Frau :Herr%-

> The real problem was that you forgot that an if-statement has to have
> quote marks around the parameters, it should read like:
> %if:"parameter"="value":"then":"else"
> Because you're using if-statements inside a rather complex macro, I
> prefer to use separators that don't occur in the rest of the macro
> that simplifies life, so I changed the above in:
> %_GAR_To="%_GAR_To%-Guten %IF:$%TIME$<$10$:$Morgen $:$Tag $%-
> %IF:$%ABTOGENDER$=$2$:$Frau $:$Herr $%-

the  real  problem is that i am not good at all at those things, and I found out
about  if  needing  quotes,  but  when I simply tried quotes it was just a mess.
Didn't know about dollar signs.

> That resulted in this QT:
> ====================================================================================
> %REM="
>    Include lasttnames of all recipients in greeting up to the maximum
>    number specified in %_GAR_Max.

>    Uses The Bat! v2 syntax.

>    Written by Robin Anson 19 Oct 2003
>    Updated 28 May 2004
>    Modified a tiny bit by Roelof Otten on request of Jurgen Haug 23 July 2004
> "%-
> %-
> %REM="
>    %_GAR_Max stores the maximum number of names you want in the greeting
>    line. Set this to suit your needs.
>    %_GAR_Default stores a default greeting to use when the message has
>    more than %_GAR_Max recipients. Set this to suit your needs.
>    %_GAR_No is the number of names in the greeting.
>    %_GAR_Text stores the original list of recipients.
>    %_GAR_Temp stores the list of recipients yet to be processed.
>    %_GAR_To stores the greeting.
> "%-
> %-
> %REM="
>    Adjust the %_GAR_Max and %GAR_Default values in the next lines to suit
>    your needs 
> "%-
> %_GAR_Max=4%-
> %_GAR_Default="Everyone,"%-
> %-
> %-%If:~%To~=~~::~%-
> %If:#%_GAR_No#=##%-
> :#%-
> %_GAR_No="0"%-
> %_GAR_Text=%ToList%-
> %_GAR_Temp="%_GAR_Text,"%-
> %_GAR_To=""%-
> %QInclude(Greet_All_Recipients)#%-
> :#%-
> %IfN:~~%_GAR_No~~<=~~%_GAR_Max~~%-
> :~~%-
> %_GAR_No=%Calculate("%_GAR_No+1")%-
> %If:'%setpattregexp="@"%regexpmatch="%_GAR_Temp"'<>''%-
> :'%setpattregexp="(?i)^((?:.*?)@(?:.*?))(?:,|;)\s*(.*)?"%-
> %regexpblindmatch="%_GAR_Temp"%-
> %To=""%To=+%subpatt="1"+%-
> %_GAR_Temp=+%Subpatt="2"+%-
> %_GAR_To="%_GAR_To%-Guten %IF:$%TIME$<$10$:$Morgen $:$Tag $%-
> %IF:$%ABTOGENDER$=$2$:$Frau $:$Herr $%-
> %Capital(%ABToHandle=^%ABToLName=+%ToLName+^), "%-
> %QInclude(Greet_All_Recipients)'%-
> :'%_GAR_To'~~
> :~~%GAR_Default~~%-
> %To=""%To="%_GAR_Text"%-
> #~
> ====================================================================================

> In my test message this resulted in:

> Guten Tag Herr Otten, Guten Tag Frau Kobes, Guten Tag Frau Otten,

 :notworthy: :notworthy: :notworthy: :notworthy: :notworthy: :notworthy: :notworthy:

 I will forward that right away to my work addy and try it on monday!
 grrr those TB macro thingies (especially if you add those regexes) make me feel
 dumb as bread.
 

> I don't know whether that is what you intended, but I guess I'll hear
> that from you.

if  you ever make it to Stuttgart, let me know in advance, so that I can get all
the beers cold IOU



-- 
Best regards,
 Jürgen
:eu-flag3: :de-bw:

"Never trust a man who can count to 1023 on his fingers"

Using The Bat! v2.12.00, Opera v7.53.3850 on Win.XP.5.1.2600.SP1

* PGP key available on request: send mail with subject 'PGP key request'

Attachment: pgpGUHzvexHGm.pgp
Description: PGP signature

________________________________________________
Current version is 2.12.00 | 'Using TBUDL' information:
http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to