-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Roelof,

@02 April 2002, 10:49:41 +0200 (09:49 UK time) Roelof Otten wrote in
[EMAIL PROTECTED]">mid:[EMAIL PROTECTED]

>>>%WRAPPED="%INCLUDE='c:\foo.txt'"

DiP>> Ooops I spoke to soon that it works... Worked for just long text in
DiP>> template but not from file.  I have:

> Does your text file consists of multiple paragraphs? (text separated
> by empty lines) In that case the wrapped-macro won't work.

Correct.

However, the 1.54/1.60 series introduces a new concept in macros -
recursion. There are some nice recursive macros to do multi-paragraph
wrapping using a couple of quick templates that look like this:

,----- [ wq ]
| %COMMENT="%QUOTES"%-
| %QINCLUDE="wrap2"
| %COMMENT=""
`-----

,----- [ wrap2 ]
| %IF:'%-
| %SETPATTREGEXP="(?is-m)[^\n]+"%-
| %REGEXPMATCH="%COMMENT"'<>'':'%-
| %-
| %WRAPPED=_%SETPATTREGEXP="(?is-m)^(.*?)(\n((\w{0,5}(\>\s*)+)?\n)+(.*)$|\z)"%-
| %-%-%-%-%-%REGEXPBLINDMATCH="%COMMENT"%-
| %-%-%-%-%-%SUBPATT="1"_
|
| %COMMENT=_%SETPATTREGEXP="(?is-m)^.*?(\n((\w{0,5}(\>\s*)+)?\n)+(.*)$|\z)"%-
| %-%-%-%-%-%REGEXPBLINDMATCH="%COMMENT"%-
| %-%-%-%-%-%SUBPATT="5"_%-
| %QINCLUDE="wrap2"'
`-----

The wq template produces wrapped quotes. We can extrapolate one that
will plain-text wrap a file like this:

,----- [ wf ]
| %COMMENT="%PUT='c:\foo.txt'"%-
| %QINCLUDE="wrap2"
| %COMMENT=""
`-----

To make that a little more flexible, we can grab a filename from the
clipboard instead, so the procedure for add a wrapped file becomes:

   1) type the filename
   2) cut the filename to the clipboard
   3) type 'wfc' <Ctrl-Space>.
   4) grin widely and carry on typing the message.

,----- [ wfc ]
| %COMMENT="%PUT='%CLIPBOARD'"%-
| %QINCLUDE="wrap2"
| %COMMENT=""
`-----

Does that help?

- --
Cheers -- .\\arck D. Pearlstone -- List moderator
SB! v1.60d/iKey1000-5523848F0B1 on Windows 2000 5.0.2195 Service Pack 2
�
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6-2 (MingW32)

iD8DBQE8qXu0OeQkq5KdzaARAgtQAJ4tblGjfpR9ZC/dSwLPETjmj4O+UQCdGG6S
B7IsAmkRRnOaapU2mqvsarA=
=w9E8
-----END PGP SIGNATURE-----



________________________________________________________
Current Ver: 1.60c
FAQ        : http://faq.thebat.dutaint.com 
Unsubscribe: mailto:[EMAIL PROTECTED]
Archives   : http://tbudl.thebat.dutaint.com
Moderators : mailto:[EMAIL PROTECTED]
TBTech List: mailto:[EMAIL PROTECTED]

Reply via email to