|
Panpardus Beginner
Joined: 27 Feb 2005 Posts: 11
|
Posted: Mon Feb 25, 2008 12:58 am
%1 keeps adding a space? |
Might be me, most likely is but I have a trigger that looks like this
^[System]\: (\w+) class (\w+)\.$
and it executes this
#if %2="enabled" {b_%1on};#if %2="disabled" {b_%1off}
The problem is that instead of executing b_Apostateon or b_Apostateoff
its puts in a space so i get b_ Apostateon and b_ Apostateoff which of course no longer matches the aliases I wish to fire
anyone got a quick solution? |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Feb 25, 2008 2:29 am |
This certainly is an annoyance and you are not the first person to come across it.
#if (%2="enabled") {#exec {%concat("b_",%trim(%1),"on")}};#if (%2="disabled") {#exec {%concat("b_",%trim(%1),"off")}}
You should really get into the habit of using () in your condition statements...
Cmud doesn't like implicit concatenation as much as Zmud does, it would have worked but I felt like being picky tonight.
You really should get into the habit of using #execute when trying to build a string then use the string as an alias.
Finally the only thing you really needed to get this to work is the %trim or %trimleft |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Panpardus Beginner
Joined: 27 Feb 2005 Posts: 11
|
Posted: Mon Feb 25, 2008 2:58 am |
Just remembered %concat then and was coming here to say not to worry I had found the problem, I also didnt need to use %trim or %trimleft and it seems to work fine.
Anyway thanks for the help and advice, its appreciated. |
|
|
|
|
|