Re: Quotation Marks in Macros
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 In message [EMAIL PROTECTED]">mid:[EMAIL PROTECTED], 8o4q-Skup [8S] wrote: 8S %To=%To=%OFROMNAME on TBUDL [EMAIL PROTECTED] 8S I know that the first pair of quotes belongs to the first %To. I 8S would guess, also, that everything following the second %To is 8S enclosed in a pair of quotes. That would mean, though, that the 8S string: 8S %OFROMNAME on TBUDL 8S is enclosed in TWO pairs of quotation marks. If so, can someone 8S tell me why? If not, where am I wrong in my analysis? If you use only one pair of quotes then the macro will be confused as to where the macro value ends and it will therefore not work. You could have also done the macro this way: %To='%OFROMNAME on TBUDL [EMAIL PROTECTED]' Doubling on the quotes is one way to prevent confusion. Using another unused character is another way of preventing the confusion. - -- -=Allie C Martin=- List Moderator | TB! v1.60q | Windows XP Pro PGP/GPG Public Key: mailto:[EMAIL PROTECTED]?Subject=2B0717E2 _ -BEGIN PGP SIGNATURE- iEYEARECAAYFAj0Liy4ACgkQV8nrYCsHF+JBmgCfVOYIn9yqqZE0Cr7RDgvZseWO v2cAoNOm/v/+8o4BV9g9zoKmPHJ/nI4E =WUrH -END PGP SIGNATURE- __ Archives : http://tbtech.thebat.dutaint.com Moderators : mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED]
Re: Quotation Marks in Macros
Hi, Allie. On Saturday, June 15, 2002, 12:45:02 PM, you wrote: If you use only one pair of quotes then the macro will be confused as to where the macro value ends and it will therefore not work. Why would it be confused? I don't understand. Here's the relevant macro from the original example: %To=%OFROMNAME on TBUDL [EMAIL PROTECTED] There are THREE sets of quotes here. You could have also done the macro this way: %To='%OFROMNAME on TBUDL [EMAIL PROTECTED]' Yes, that makes much more sense to me. Notice also that there are just two sets of quotes here: a pair of single quotes and a pair of double quotes. Thanks for the reply. -- Keith Using The Bat! 1.60q under Windows XP 5.1 Build 2600 on a Pentium IV 2.4 with 512 MB. __ Archives : http://tbtech.thebat.dutaint.com Moderators : mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED]
Re: Quotation Marks in Macros
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Keith, @15 June 2002, 13:37:23 -0600 (20:37 UK time) Keith Russell wrote in [EMAIL PROTECTED]">mid:[EMAIL PROTECTED] %To=%To=%OFROMNAME on TBUDL [EMAIL PROTECTED] These are embedded literal quotes. I guess you're saying that the embedded quotes will be displayed, to give something like: Marck D Pearlstone on TBUDL [EMAIL PROTECTED] Yes. as opposed to: Marck D Pearlstone on TBUDL [EMAIL PROTECTED] which would result from: %To=%To=%OFROMNAME on TBUDL [EMAIL PROTECTED] Am I right? Actually - no! This won't work at all. It results in: %To= ; Blank the To field %To= ; Blank the To field again %OFROMNAME on TBUDL [EMAIL PROTECTED] ; Include the literal string in the message, quotes and all. However, that macro could have been written: %To=%To='%OFROMNAME on TBUDL [EMAIL PROTECTED]', which makes much more sense. Yes, the same as Allie's suggestion, which is easily understandable, but does NOT have the embedded literal quotes, unless I've misunderstood. You have. Doubling up of embedded quotes is only necessary when the string delimiter is the same quote type. When using single quotes as the string delimiter, double quotes can be embedded without having to double them up, but single quotes would have to be double. (Huh? What?). %To=%To=%OFROMNAME on TBUDL [EMAIL PROTECTED] %To=''%To='%OFROMNAME on TBUDL [EMAIL PROTECTED]' %To=%To='%OFROMNAME on TBUDL' [EMAIL PROTECTED] %To=''%To='''%OFROMNAME on TBUDL'' [EMAIL PROTECTED]' Variant 3 and 4 are complete nonsense because you can't use single quotes as delimiters in To: fields. Would the following work and result in the literal quotes? %To=%To='%OFROMNAME on TBUDL' [EMAIL PROTECTED] No, it wouldn't. It set's To: to a single quote and includes the rest as text in the message body. Use the one I gave (number two above). In fact, I think something like this (or the original), rather than the one you and Allie suggested, would be needed to avoid the Allie C Martin on [TBUDl] [EMAIL PROTECTED] which is causing Allie problems, wouldn't it? Yes. - -- Cheers -- .\\arck D. Pearlstone -- List moderator TB! v1.60q-5523848F0B1 on Windows 2000 5.0.2195 Service Pack 2 ' -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7a-nr2b1 (Windows 2000) iD8DBQE9C5yMOeQkq5KdzaARAskPAKCV7nUgYgE/On+QAnlq1YmyxJCpAgCeLywq UEXWKn951dmpSMPQOyl/vmI= =XsYZ -END PGP SIGNATURE- __ Archives : http://tbtech.thebat.dutaint.com Moderators : mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED]
Re: Quotation Marks in Macros
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Keith, @15 June 2002, 16:46:31 -0600 (23:46 UK time) Keith Russell wrote in [EMAIL PROTECTED]">mid:[EMAIL PROTECTED] Please forgive the major snippage, but I read it all and only need to address the summary. So, the gist of all this, I think, is in two of your statements: 1. Doubling up of embedded quotes is only necessary when the string delimiter is the same quote type. When using single quotes as the string delimiter, double quotes can be embedded without having to double them up, but single quotes would have to be double. 2. You can't use single quotes as delimiters in To: fields. Yes!!! Are these two points explained anywhere in Help or the FAQ? It seems that they're critical to a good understanding of macros, and if I do understand the way they work now (I think I do), the whole thing now makes complete sense. This was the missing link! ,-=[ From the TB Help Template Macros topic header ] A special note about using macro parameters: Macro parameters can be enclosed either in double quotes or apostrophes. To use a double quote or apostrophe within a macro parameter when the enclosing quote character is the same, use a pair of the required character instead of a single one. E.g.: in %MACRO='my double quoted text' the macro parameter is my double quoted text ; it is also possible to use this construct instead: %MACRO=my double quoted text - note the doubled double quotes inside the macro parameter. ` - -- Cheers -- .\\arck D. Pearlstone -- List moderator TB! v1.60q-5523848F0B1 on Windows 2000 5.0.2195 Service Pack 2 ' -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7a-nr2b1 (Windows 2000) iD8DBQE9C8b4OeQkq5KdzaARAidRAKDGGsyoIiTsDAw+RSTDm8eiJRyrSQCfRxgi uDPknFrRW5BSZpg20SKDGpI= =ogIo -END PGP SIGNATURE- __ Archives : http://tbtech.thebat.dutaint.com Moderators : mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED]
Re: Quotation Marks in Macros
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 In message [EMAIL PROTECTED]">mid:[EMAIL PROTECTED], 8o4q-Skup [8S] wrote: 8S So, the gist of all this, I think, is in two of your statements: 8S 1. Doubling up of embedded quotes is only necessary when the 8Sstring delimiter is the same quote type. When using single quotes as 8Sthe string delimiter, double quotes can be embedded without having to 8Sdouble them up, but single quotes would have to be double. Yes. 8S 2. You can't use single quotes as delimiters in To: fields. Yes. Remember that another reason to be doubling up is what I was alluding to earlier, i.e., when recursively using macros with string values. In the example, you gave above, the aim is to literally enclose part of the %To macros' string value within quotations. Consider also, a macro as this: %subject=%Qinclude=subjstrip otherwise written: %subject='%Qinclude=subjstrip' 8S Are these two points explained anywhere in Help or the FAQ? Yes. Contents/Message Templates/The Complete List of Template Macros. The paragraph below the linked template macro categories explains this issue. 8S It seems that they're critical to a good understanding of macros, 8S and if I do understand the way they work now (I think I do), the 8S whole thing now makes complete sense. This was the missing link! Once you pass that hurdle, a lot of possibilities appear. Learning a little on regular expressions creates even more possibilities.;-) - -- -=Allie C Martin=- List Moderator | TB! v1.60q | Windows XP Pro PGP/GPG Public Key: mailto:[EMAIL PROTECTED]?Subject=2B0717E2 _ -BEGIN PGP SIGNATURE- iEYEARECAAYFAj0Lx5IACgkQV8nrYCsHF+Li9gCg9WdMS7kCYR/zw5SJQAkBUk+P 0e4An2YrxflVJBiLvKAXEsx9nBBFmcRF =aIvI -END PGP SIGNATURE- __ Archives : http://tbtech.thebat.dutaint.com Moderators : mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED]
Re: Quotation Marks in Macros
Hi, Marck. On Saturday, June 15, 2002, 5:00:05 PM, you wrote: ,-=[ From the TB Help Template Macros topic header ] A special note about using macro parameters: Macro parameters can be enclosed either in double quotes or apostrophes. To use a double quote or apostrophe within a macro parameter when the enclosing quote character is the same, use a pair of the required character instead of a single one. E.g.: in %MACRO='my double quoted text' the macro parameter is my double quoted text ; it is also possible to use this construct instead: %MACRO=my double quoted text - note the doubled double quotes inside the macro parameter. ` Thanks for pointing this out to me. Actually, it makes sense to me now, but I don't think it would have before. Unfortunately, this topic is one that is VERY difficult to write about and make it understandable. -- Keith Russell mailto:[EMAIL PROTECTED] printf(to C or not to C...that is the question/n); Using The Bat! 1.60q under Windows XP 5.1 Build 2600 on a Pentium IV 2.4 with 512 MB. __ Archives : http://tbtech.thebat.dutaint.com Moderators : mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED]