Hi Carsten,
On Wednesday, June 18, 2003 at 02:03 GMT +0200, a creature mimicking
Carsten Th�nges wrote:
> Is it a good idea to take a %_wrap_limit "parameter" into account
> and do something like shown in the follwing pseudo code?
> if %_wrap_limit == "":
> %Wrapped(%_Wrap_Paragraph_1)
> else:
> %Wrapped(%_wrap_limit, %_Wrap_Paragraph_1)
Good call. Of course, your pseudo-code is fairly close to real code,
so:
=====[Begin wrap QT]=====
%REM='
Multi-Paragraph wrapping routine using features from TB 1.63b11
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 QT]=====
And your addition to the driver template looks good with a very minor
modification.
=====[Begin Driver Template]=====
%_Wrap_Text="%Quotes"%-
%_Wrap_Limit="50"%-
%QInclude(wrap)%-
=====[ End Driver Template]=====
--
Thanks for writing,
Januk Aggarwal
Using The Bat! 1.63 Beta/11 under Windows 98 4.10 Build 2222 A
________________________________________________________
Current beta is 1.63b11 | "Using TBBETA" information:
http://www.silverstones.com/thebat/TBUDLInfo.html