Hi Marck,

On Wednesday, October 15, 2003 at 01:56 GMT +0100, a creature
mimicking Marck Pearlstone [MP] wrote:

MP> I have done it. It's taken a while, but I've uploaded v2 modified
MP> entries to the Macro Library.

It looks good.  Thanks.

MP> What I have done is to follow the v1 QT macros with v2 versions
MP> below where necessary. Please feel free to check my work and suggest
MP> improvements or corrections as necessary.

The versions of the recipient list, recipient list-indented and wrap2
are all basic versions.  I had gotten them to the point where the
recursive part is much more flexible, and so some of the stuff there
is redundant.  But with the improvements, I'm not entirely sure what's
the best way to incorporate them into the library.

Perhaps for those three, the version 2 adaptation can just point to
new entries:

-=-=-=-=-=-=-= Wrap -=-=-=-=-=-=-
The multi-paragraph wrapping template is a general purpose template
that can be used on it's own, or in conjunction with other templates.

To wrap and insert text from the clipboard, simply copy your text to
the clipboard, type "wrap" (no quotes) followed by <ctrl><space> in
the editor.

When called from a template, the calling template should put the text
to be wrapped in %_Wrap_Text before the wrap template is called.
There is also an optional wrap length parameter, %_Wrap_Limit if a
certain column length is desired.  The following is an example driver
template that will wrap quoted text to 50 characters.

=====[Begin example driver]=====
%_Wrap_Text="%Quotes"%-
%Rem="This line is optional"%___%_Wrap_Limit="50"%-
%QInclude(wrap)%-
=====[ End  example driver]=====

=====[Begin wrap template]=====
%REM='
       Multi-Paragraph wrapping routine using features from TB v2
       Written June 2003 by Januk Aggarwal

       Notes:
          1. This template can be used alone to wrap clipboard
             contents or can be used as a wrapping engine by assigning
             text to the variable, %_Wrap_Text, in the driver template.
          2. Wrapping limit can be set optionally by defining the
             variable %_Wrap_Limit in the driver template
'%-
%-
%IF:'%_Wrap_FirstTime'='':'%-
%___%IF:"%_Wrap_Text"="":"%_Wrap_Text(%Clipboard)"%-
%___%_Wrap_FirstTime="No"'%-
%-
%IF:'%-
%SetPattRegexp="(?is-m)[^\n]+"%-
%RegexpMatch(%_Wrap_Text)'<>'':'%-
%-
%SetPattRegexp="(?is-m)^(.*?)((\n((\w{0,5}(\>\s*)+)?\s*\n)+)(.*)\s*$|\z)"%-
%RegexpBlindMatch(%_Wrap_Text)%-
%-
%_Wrap_Paragraph_1(%Subpatt(1))%-
%_Wrap_Blank_Space(%Subpatt(3))%-
%_Wrap_Remainder_Of_Text(%Subpatt(7))%-
%-
%If:"%_Wrap_Limit"="":"%-
%____%Wrapped(%_Wrap_Paragraph_1)":"%-
%____%Wrapped(%_Wrap_Limit, %_Wrap_Paragraph_1)"

%_Wrap_Text(%_Wrap_Remainder_of_Text)%-
%-
%QInclude(wrap)'%-
=====[ End  wrap template]=====

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


-=-=-=-= Recipient List -=-=-=-=-

The recipient list reformatting template is a general purpose template
that can be used on it's own, or in conjunction with other templates.
This template will convert a comma/semicolon separated list into a
list with each entry on it's own line.

To convert a list from the clipboard, simply copy your text to the
clipboard, type "Recipient_List" (no quotes) followed by <ctrl><space>
in the editor.

When called from a template, the calling template should put the text
to be reformatted in %_RL_Text before the wrap template is called.
There is also an optional indent space parameter, %_RL_Num_Space if a
certain indent is desired.  The following two templates are: a sample
print template and its driver template.

=====[Begin example print QT]=====
-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    From: %FromName <%FromAddr>
    Date: %ODateEn %OTimeLongEn                          %IF:'%TOLIST'<>'':'
      To: %_RL_Text="%TOLIST; "%QINCLUDE="recipient driver"' %IF:'%CCLIST'<>'':'
      Cc: %_RL_Text="%CCLIST; "%QINCLUDE="recipient driver"' %IF:'%BCCLIST'<>'':'
     Bcc: %_RL_Text="%BCCLIST; "%QINCLUDE="recipient driver"'
 Subject: %FullSubj
-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

%text

-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=====[ End  example print QT]=====

=====[Begin Recipient Driver QT]=====
%_RL_Num_Space("10")%-
%SetPattRegexp="^(?s)\s{%_RL_Num_Space}(.*)\Z"%-
%RegExpMatch="%-
%___%QInclude='Recipient List'"%-
=====[ End  Recipient Driver QT]=====


=====[Begin Recipient_List QT]=====
%REM='
       Recipient List reformatting routine using features from TB v2
       Written July 2003 by Januk Aggarwal

       Notes:
          1. This template can be used alone to reformat clipboard
             contents or can be used as a reformatting engine by
             assigning text to the variable, %_RL_Text, in the driver
             template. 
          2. Indenting can be specified  by defining number of leading
             spaces in %_RL_Num_Space variable.
'%-
%-
%IF:'%_RL_FirstTime'='':'%-
%___%IF:"%_RL_Text"="":"%_RL_Text(""%Clipboard; "")"%-
%___%IF:"%_RL_Num_Space"!="":"%-
%______%SetPattRegexp=""(\s{%_RL_Num_Space})""%-
%______%RegExpBlindMatch=""                                                            
                                    ""%-
%______%_RL_Leading_Space(%SubPatt(1))":"%-
%______%_RL_Leading_Space()"%-
%___%_RL_FirstTime="No"'%-
%-
%IF:'%_RL_Text'!='':'%-
%-
%___%SetPattRegexp=!(?x)
      ^\s*                     # Strip Leading Spaces
      (                        # SubPatt 1 - First Item + Delimiter
        (                      # SubPatt 2 - First Item
          (\"?)                # Opening Quotation marks
            (.*?)              # SubPatt 4 - Name
          \3                   # Closing Quotation marks if opening ones exist
          \s*
          (\<.*?\>)?           # SubPatt 5 - Address
        )                      # Close First Item
        \s*[;,]\s*             # Delimiter and white space
      )                        # Close First Item + Delimiter
      (.*)                     # SubPatt 6 - Remainder of list
      \Z!%-
%___%RegexpBlindMatch(%_RL_Text)%-
%-
%___%_RL_Name_Addr(%SubPatt(2))%-
%___%_RL_Name(%SubPatt(4))%-
%___%_RL_Addr(%SubPatt(5))%-
%___%_RL_Text(%SubPatt(6))%-
%-
%___%_RL_Leading_Space%-
%___%If:%_RL_Name!="":"%_RL_Name "%-
%___%_RL_Addr
%-
%QInclude("Recipient_List")'%-
=====[ End  Recipient_List QT]=====

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




-- 
Thanks for writing,
 Januk Aggarwal




________________________________________________________

http://www.silverstones.com/thebat/TBUDLInfo.html

Reply via email to