|
Blerghass Beginner
Joined: 25 Nov 2001 Posts: 26 Location: USA
|
Posted: Mon Dec 24, 2001 7:27 pm
Removing the CR/LF at the end of a received line |
I'm trying to do something pretty simple, but I haven't figured out how to do it.
Basically, a line of text comes in like this:
blah blah blahGSI
blah2 blah2 blah2
I want to trigger on GSI$ and remove the carriage return at the end of the line when it triggers, leaving it like this:
blah blah blahblah2 blah2 blah2
I've gotten it to work, kind of, with multiline triggers, but I'd much rather do it with a single line trigger, if possible. Nothing specific on the second line to trigger anyhow. Using #SUB leaves the carriage return there (strangely, it does this only on oneline triggers, not on multiline triggers).
Thanks for any help you can give. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Mon Dec 24, 2001 9:39 pm |
Sadly I believe the only way to do this is with a multiline trigger and sub.
#TR {GSI$(*)} {#SUB {%1}}
I guess there aren't always 20 ways to skin a cat in Zmud |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Mon Dec 24, 2001 9:42 pm |
This will work in 6.20+:
#TRIGGER {^(%*)GSI$} {#gag}
#COND {^(%*)$} {#sub {%t1%t2}} {"within"|"param=1"}
States can be used (as they are here) as a replacement for the multiple line triggers used in previous versions. They have the advantage of speed.
There might be a way to do it without any visible jerkiness due to #gagging but without resorting to a multi-line, nothing comes immediately to mind.
- Charbal |
|
|
|
Blerghass Beginner
Joined: 25 Nov 2001 Posts: 26 Location: USA
|
Posted: Tue Dec 25, 2001 3:23 am |
Thanks for the help. In fact, I started thinking about using two separate triggers, the second of which would trigger on ^(*)$, but would only be enabled when the first trigger GSI$ was set off. Basically the same idea as multistate trigger Charbal suggested. Again thanks for the quick responses.
|
|
|
|
SHASCO Novice
Joined: 29 May 2001 Posts: 48 Location: USA
|
Posted: Wed Dec 26, 2001 10:56 pm |
I believe that in the preferences you can uncheck auto word wrap under preferences, general, word wrap. This will stop zmud from word wrapping.
Then you can check your mudd to see if they have a command that will let you set the character width for your session. I use a 17" monitor and have changed the mudd setting to accomodate the width which has resolved most of the issues that your talking about. For me anyway. |
|
|
|
|
|