 |
Rugbystyle Wanderer
Joined: 07 Oct 2001 Posts: 71
|
Posted: Fri Aug 22, 2003 7:10 am
Variable Evaluation assistance |
What I'm trying to do is have a trigger that checks if the line before it ended in a blank space.
Here's and example of a few methods I've tried (and failed with) so far...
#TRIGGER {sample text here} {SpaceEvaluation=%line2;#IF (%ends(@SpaceEvaluation,%s)) {#SAY space} {#SAY no space}}
#TRIGGER {sample text here} {SpaceEvaluation=%line2;#IF (%ends(@SpaceEvaluation," ")) {#SAY space} {#SAY no space}}
#TRIGGER {sample text here} {SpaceEvaluation=%line2;#IF (%rightback(@SpaceEvaluation,1)=" ") {#SAY space} {#SAY no space}}
Unfortunately none of those worked, and I couldn't figure out any other methods to try. I just can't get it to recoginize and act on the blank space at the end of a variable. Any suggestions and help would be greately appreciated. |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Fri Aug 22, 2003 7:29 am |
#TRIGGER {%s$sample text here} {#SAY Got it?}
|
|
|
 |
Rugbystyle Wanderer
Joined: 07 Oct 2001 Posts: 71
|
Posted: Fri Aug 22, 2003 7:46 am |
That works. However, I want the trigger to fire even when the line before it DOESN'T end in a white space. I want two different reactions, one for if it had a white space at the end, and one for if it did not. That's why I was trying to use an #IF statement evaluation of the %line2. So when I used that trigger, it would only fire if the line before it ended in a whitespace
So any help with an #IF statement evaluation of the variable, getting it to recognize a variable that ends in a whitespace?
Thanks, if anyone can help here. |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Fri Aug 22, 2003 8:05 am |
How about then
#TRIGGER {(*)$sample text here} {#IF ("%1" = %trimright("%1")) {#SAY No Space} {#SAY Space}} |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Aug 22, 2003 6:43 pm |
And of course, there's always the two trigger solution.
#TR {%s$sample text here} {#SAY Space}
#TR {%x$sample text here} {#SAY No Space} |
|
|
 |
|
|