Hallo Jurgen, On Fri, 23 Jul 2004 17:35:45 +0200GMT (23-7-2004, 17:35 +0200, where I live), you wrote:
JH> thanks for the info - it works .... on it's own, but ... Of course, after all I tested it. <g,d&r> 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. 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? 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 $%- 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, I don't know whether that is what you intended, but I guess I'll hear that from you. -- Groetjes, Roelof Disclaimer: Any opinion stated in this message is not necessarily shared by my budgies or rabbits. ________________________________________________ Current version is 2.12.00 | 'Using TBUDL' information: http://www.silverstones.com/thebat/TBUDLInfo.html