|
NoBrainer Newbie
Joined: 29 Sep 2009 Posts: 4
|
Posted: Sun Oct 04, 2009 9:04 am
First word in sentence |
How do I store the first word of a sentence in a variable?
Example:
Pattern: {@names} walks (*).
Value: #SUB {Something flies to the %1 with a smile on its face}
@names is just a long list of names
I don't want it to say "Something" flies... obviously.
If I switch "Something" with @names it will list the whole list of names when the trigger executes, which I don't want either.
I just want the specific name from the name list to show in the sub.
Perhaps there is a way to store the first word of the sentence, which would be the specific name I want, in a temp variable, then use that variable instead of Something?
But I can't find how. Someone able to help?
Thanks again, you guys are very helpful here. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Oct 04, 2009 4:05 pm |
You can surround {@names} with (). This will capture it into the %1 variable, so you need to change your existing %1's that refer to the (*) to %2.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
NoBrainer Newbie
Joined: 29 Sep 2009 Posts: 4
|
Posted: Sun Oct 04, 2009 4:54 pm |
Thanks Matt!
|
|
|
|
|
|