|
XonDK Apprentice
Joined: 01 Dec 2006 Posts: 178
|
Posted: Wed Aug 01, 2007 12:11 pm
Feature I'd like to see in CMUD 2 |
Call me weird, but I'd love an alternative way for #SAY....#SAYADD
the difference would be.
(trigger text)
(output from normal #SAY)
#SAYADD would give.
(trigger text) (output from #SAYADD)
I know I can use sub and psub to do it, but it gets ugly and requires capturing the end of the text to fire it.
if there already is something like this then i've missed it somehow. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Aug 01, 2007 12:20 pm |
Capturing the end of the text?
#trig {whatever} {#sub %line something at the end}
EDIT: I actually had a couple of issues getting this simpler code to work. This worked
#trig {whatever} {#sub %concat(%line," something at the end")}
but running the command above ended up with "#sub {at}" as the trigger's command, and leaving out the %concat caused the #sub not to run. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Aug 01, 2007 12:42 pm |
#ALIAS SayAdd {$x=%len(%line);#SAYPROMPT {%char(27)[A};#PSUB {%-1} $x}
I never tested it but that should work. If you are looking to do it with a prompt then you can remove the VT code in there that is pushing the cursor up. It might also cause the cursor to become mispositioned. Try it out and let me know if it needs any tweaking. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Aug 01, 2007 12:47 pm |
Seems overly complicated and it's not working exactly right anyway. Here's my test case:
#loop 10 {#say some line with some text on it %i}
$x=%len(%line);#SAYPROMPT {%char(27)[A};#PSUB {test for the end} $x
and it gave this:
some line with some text on it 8
some line with some text on it 9stest for the endome line with some text on it 10 |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Aug 01, 2007 1:23 pm |
Hrm, something about the #PSUB automatically handles getting to the correct line, so the up code isn't needed. Also the way I had it was replacing the EOL codes which is why it was moving the lower line up.
#ALIAS SayAdd {#PSUB {%-1%cr} %len(%line)} |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
XonDK Apprentice
Joined: 01 Dec 2006 Posts: 178
|
Posted: Wed Aug 01, 2007 3:57 pm |
Interesting idea's, would be easier/cleaner with a direct coded command?
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Aug 01, 2007 7:29 pm |
Well, I think the posts here prove the point that XonDK was mentioning...it's pretty complicated. I can see where something like this might be useful, and I'll put it on the wish list for a future version. It won't be in the v2.0 yet though, sorry. Too much stuff on my list for 2.0 already.
|
|
|
|
XonDK Apprentice
Joined: 01 Dec 2006 Posts: 178
|
Posted: Wed Aug 01, 2007 11:36 pm |
Zugg wrote: |
Well, I think the posts here prove the point that XonDK was mentioning...it's pretty complicated. I can see where something like this might be useful, and I'll put it on the wish list for a future version. It won't be in the v2.0 yet though, sorry. Too much stuff on my list for 2.0 already. |
as long as its on wishlist, You make me an even more happy cmud user :) |
|
|
|
|
|