Hello Carsten, An archeological dig discovered that on Friday, November 23, 2001 at 09:57 GMT +0100, Carsten Th�nges [CT] typed the following:
CT> Footnotes are being pasted right above the '-- ' or - if there is CT> none - under the last line. CT> !!! The maximum number of footnotes is 9 !!! Very clever. A minor adjustment to the regexps will allow an arbitrary number of footnotes. See below. --[ QT: fn ]==----====----====----====----====----====----====----====-- %REM='Footnotes'%- %REM=''%- %REM='Copy counter and clipboard into comment'%- %REM='Call fn2'%- %REM='Cut counter variable out of comment'%- %REM='Print and clear comment'%- %COMMENT='0;-;%CLIPBOARD'%- %QINCLUDE='fn2'%- %SETPATTREGEXP='(?ism)\d+\;\-\;(.*)'%- %REGEXPMATCH='%COMMENT'%- %COMMENT=''%- --====----====----====----====----====----====----====----====----====-- CT> fn2 is only called by fn and itself. =-[ QT: fn2 ]-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- %REM='Is there still a (FN:.*$#)?'%- %REM='If yes: Split and rebuild comment'%- %REM=' Increase counter and save it in position 1.'%- %REM=' Cut FN text and paste it to the right place'%- %REM=' Call this QT again.'%- %- %IF:'%- %SETPATTREGEXP="(?ism)\(FN:.*?#\)"%- %REGEXPMATCH="%COMMENT"'<>''%- :'%- %COMMENT=_%- %SETPATTREGEXP="(?ism)^(\d+)\;\-\;(.*?)(\(FN:(.*?)#\))(.*?)(^-- $.*|\z)"%- %REGEXPBLINDMATCH="%COMMENT"%- %CALC="%SETPATTREGEXP=~^(\d+)~%REGEXPMATCH=~%COMMENT~+1";-;%- %subpatt="2"%- [%CALC="%SETPATTREGEXP=~^(\d+)~%REGEXPMATCH=~%COMMENT~+1"]%- %subpatt="5"%- [%CALC="%SETPATTREGEXP=~^(\d+)~%REGEXPMATCH=~%COMMENT~+1"] %SUBPATT="4" %SUBPATT="6"_%- %- %QINCLUDE="fn2"'%- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Here is the test of the modified templates: ,----- [ Begin ] ----- | | Some text (FN:[EMAIL PROTECTED]#) | New text (FN:[EMAIL PROTECTED]#) | More text (FN:[EMAIL PROTECTED]#) | How many can I generate? (FN:[EMAIL PROTECTED]#) | Maybe a note rather than an address. (FN:I am super#) | Or a question. (FN:Am I the only one talking?#) | Back to addresses. (FN:[EMAIL PROTECTED]#) | These addresses (FN:[EMAIL PROTECTED]#) better not get spammed. | If I see this one (FN:[EMAIL PROTECTED]#) I'll report to |(FN:[EMAIL PROTECTED]#). | Well, this concludes my test (FN:[EMAIL PROTECTED]#) | `----- [ End ] ----- Here is the result: ,----- [ Begin ] ----- | | Some text [1] | New text [2] | More text [3] | How many can I generate? [4] | Maybe a note rather than an address. [5] | Or a question. [6] | Back to addresses. [7] | These addresses [8] better not get spammed. | If I see this one [9] I'll report to [10]. | Well, this concludes my test [11] | [1] [EMAIL PROTECTED] | [2] [EMAIL PROTECTED] | [3] [EMAIL PROTECTED] | [4] [EMAIL PROTECTED] | [5] I am super | [6] Am I the only one talking? | [7] [EMAIL PROTECTED] | [8] [EMAIL PROTECTED] | [9] [EMAIL PROTECTED] | [10] [EMAIL PROTECTED] | [11] [EMAIL PROTECTED] | `----- [ End ] ----- -- Thanks for writing, Januk Aggarwal Using The Bat! 1.54/10 under Windows 98 4.10 Build 2222 A OK, I'm weird! But I'm saving up to become eccentric. -- ______________________________________________________ Archives : http://tbtech.thebat.dutaint.com Moderators : mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED]
