kernighan Novice
Joined: 14 May 2004 Posts: 37
|
Posted: Wed May 25, 2005 5:08 am
Multiple SUBS |
In playing with subs, both as #sub, and #pcol/#psub, it seems that if you want to perform multiple actions on an item of text, you must do them in order.
For example, I do distance subs like:
#TRIGGER {immediate area, %1} {#sub {immedate area, %1 %ansi(bold,yellow)(0-1)}}
#TRIGGER {close by, %1} {#sub {close by, %1 %ansi(bold,yellow)(2-5)}}
#TRIGGER {not far from here, %1} {#sub {not far from here, %1 %ansi(bold,yellow)(6-10)}}
#TRIGGER {, off in the distance, %1} {#sub {, off in the distance, %1 %ansi(bold,yellow)(11-15)}}
#TRIGGER {several miles away, %1} {#sub {several miles away, %1 %ansi(bold,yellow)(16-25)}}
#TRIGGER {, far off in the distance, %1} {#sub {, far off in the distance, %1 %ansi(bold,yellow) (26-50)}}
#TRIGGER {tens of miles away in the distance, %1} {#sub {tens of miles away in the distance, %1 %ansi(bold,yellow)(51-75)}}
#TRIGGER {many miles away, %1} {#sub {many miles away, %1 %ansi(bold,yellow)(76-100)}}
#TRIGGER {a great distance away, %1} {#sub {a great distance away, %1 %ansi(bold,yellow)(101+)}}
Sometimes, there might be a campfire nearby, which I want to highlight in red, so I also have the following trigger:
#TRIGGER {rising from a campfire} {#PCOL bold,red %x1}
This will only work if it comes after all of the distance subs.
I played with using #PCOL in the distance subs, and hit the same problem in that things were order dependant.
How can I modify these so that they are not order dependant?
Thanks,
Kernighan |
|