|
sammael Newbie
Joined: 03 May 2002 Posts: 5
|
Posted: Wed Oct 23, 2002 3:41 pm
Prompt or Blank Line Matching in a Single Trigger |
I'm wondering if this is possible. I'd like to use a single trigger to disable text capturing, but it would have to fire on either a simple prompt or a blank lane. I played with this a bit last night and couldn't find a way to get the pattern correct.
I can get the prompt (just a single right angle-bracket) to trigger if I use a string list, but because it's a string list, it doesn't accept the dollar sign as a blank line pattern, and I can't figure out how to escape it. Also, if I try to make the prompt trigger only at the beginning of a line, it winds up negating the match, because a carat in a string list causes it not to match. ;)
It probably isn't possible, but I figured I'd ask just in case.
The closest I came (in theory, it never came close to working) was: {>|~$} |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Oct 23, 2002 6:08 pm |
I don't know if it's possible or not, but I'm always amazed that people will spend hours trying to combine things into a SINGLE trigger, when they could have the problem solved in a couple minutes if they'd just use TWO triggers.
LightBulb
Senior Member |
|
|
|
sammael Newbie
Joined: 03 May 2002 Posts: 5
|
Posted: Wed Oct 23, 2002 6:30 pm |
Glad to provide you with some amazement, chief. That's of course what I wound up doing, but it didn't quell my curiosity as to whether or not the initial experiment was possible.
Consider it an intellectual exercise. |
|
|
|
Lalaynya Wanderer
Joined: 23 Aug 2002 Posts: 96
|
Posted: Wed Oct 23, 2002 6:53 pm |
quote:
I'm wondering if this is possible. I'd like to use a single trigger to disable text capturing, but it would have to fire on either a simple prompt or a blank lane. I played with this a bit last night and couldn't find a way to get the pattern correct.
I can get the prompt (just a single right angle-bracket) to trigger if I use a string list, but because it's a string list, it doesn't accept the dollar sign as a blank line pattern, and I can't figure out how to escape it. Also, if I try to make the prompt trigger only at the beginning of a line, it winds up negating the match, because a carat in a string list causes it not to match. ;)
It probably isn't possible, but I figured I'd ask just in case.
The closest I came (in theory, it never came close to working) was: {>|~$}
Ok, if the > prompt goes on a line by itself(ie: is followed by a carriage return) then this pattern should work:
{>|}$ |
|
|
|
sammael Newbie
Joined: 03 May 2002 Posts: 5
|
Posted: Wed Oct 23, 2002 7:34 pm |
I probably should have mentioned that it doesn't. The prompt will occur inline with whatever follows it, and it won't necessarily occur first; either a blank line or the prompt could signify the end of what I'm capturing.
|
|
|
|
Tarn GURU
Joined: 10 Oct 2000 Posts: 873 Location: USA
|
Posted: Wed Oct 23, 2002 8:18 pm |
Some examples would be nice. Lacking them, I'll offer a pointer to
http://www.zuggsoft.com/library/trigadv.htm
and ask if a regular expression trigger takes care of what you need for your experiment since that allows pretty much anything you want (including wildcards) in a list of alternative patterns. (I've never tried doing regexp with a prompt trigger, but will check it out tonight).
-Tarn |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Oct 23, 2002 10:30 pm |
Yes is very easily done.
#class blahblahcapture
#tr {blahblah} {blather}
#TR {^{>|}$} {#T- blahblahcapture} "" {prompt}
#class 0
Dont copy the ones in lower case they are to show that you put the trigger inside the class it will turn of. The reason for this is the trigger could fire twice if it is not turned off as well. Might not be much of a problem if all it does is turn off a class, but because your example was limited I will not offer further support of the trigger itself. |
|
|
|
|
|