|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Thu Jul 16, 2009 12:55 am
%quote, %string doesn't work the way the help files indicate. |
Maybe I'm misunderstanding the help files, but it says %quote returns the string with any special characters quoted, and %string converts the string into, well, a string.
However, if I do something like...
#ALIAS reply {#EXECWIN MainWindow {repl %quote(%params(1))}}
and try to do
reply (By the way, this is just a test.)
it comes back with an illegal expression popup. The only way I can get around it is by manually making it into a string by
reply "(By the way, this is a test.)"
Isn't quote or string supposed to bypass all that? Or am I reading it wrong?
Charneus
Edit: Fixed, but that was only because I typed it out here - never was the problem for me there... ;) |
|
Last edited by charneus on Thu Jul 16, 2009 1:20 am; edited 1 time in total |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Thu Jul 16, 2009 1:12 am |
Your missing a closing curly bracket for one. But that doesn't fix the issue.
For some reason it says the comma is an illegal character. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Thu Jul 16, 2009 2:16 am |
I believe the problem is that cmud needs to parse the argument even before it execute the reply alias. If you do:
reply $foobar
it will evaluate $foobar before it actually executes 'reply'. So the problem is not with %quote, because the %quote is executed too late. Basically, you can't do what you wanted to do. |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Thu Jul 16, 2009 5:43 am |
Rahab is right on this. %quote takes your alias parameter without the (), because the parenthesis are used in CMUD to indicate an expression. CMUD must evaluate your expression and pass the result to calling alias, where you have your %quote function call. Your expression can't be evaluated, so CMUD pops an error. To fix that use {} around alias argument
reply {(By the way, this is just a test.)}
I've ran in exactly the same problem some time ago when I tried to pass a text in the () to #MXP. You may want to look here: http://forums.zuggsoft.com/forums/viewtopic.php?t=31574 |
|
_________________ My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Jul 16, 2009 5:59 am |
You can also turn off the "Expand Arguments" option for your "reply" alias to prevent CMUD from parsing the () characters as an expression evaluation.
|
|
|
|
|
|