|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Mon Aug 18, 2008 4:56 pm
[2.36] #MXP send tag - parsing error |
From the help file:
#MXP This is a <send 'hello'>test</send>
will create a hyperlink called "test", but now, when you click on it, the command "hello" is sent to the MUD instead.
Ok, that sample works, but this not:
#MXP This is a <send 'hello'>(test)</send>
Parse error: illegal token (test)</send>
This also works:
#MXP This is a <send 'hello'>test)</send>
Resume: there is a problem with opening parenthesis. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Aug 18, 2008 5:36 pm |
You need to put {} around your argument for #MXP:
#MXP {This is a (test)}
That tells CMUD to treat it as a string and not try to evaluate expressions on the command (the parenthesis are used in CMUD to indicate an expression).
For example:
#SHOW (1+1)
displays "2" because it uses the parenthesis to evaluate an expression. Whereas
#SHOW {(1+1)}
displays "(1+1)" because the {} indicate a string value. All CMUD commands work like this, not just #SHOW or #MXP. |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Mon Aug 18, 2008 5:43 pm |
Ok, then consider this:
A function (#FUNC) with return type String (literal):
#RETURN "#MXP 1 (Apply changes)",
where (Apply changes) is properly formatted link within send tag.
Should #EXEC on that function result evaluate it? |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Aug 18, 2008 7:20 pm |
Yes. Again, you need to put {} around your MXP argument:
#RETURN "#MXP 1 {(Apply changes)}"
Otherwise when you call #EXEC to execute the #MXP command, the #MXP command will still see the parens instead of the {} braces. |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Mon Aug 18, 2008 8:49 pm |
Ok, thanks!
The problem was in that function didn't throw any error message, just blank result and I've found the source of it only when tried the script from that function in the command line. |
|
|
|
|
|