 |
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: Sat Nov 14, 2009 7:13 pm
Error in CMUD help file? |
Help file:
| Quote: |
eval
Syntax: %eval(expression)
evaluate the expression and return the result
NB: Do not use this function unless you're sure you have to. While it was used very often in zMUD, most of its uses have been deprecated in CMUD. In CMUD, evaluating an expression is as simple as surrounding it in brackets.
Use of this function is inadvisable because its argument is treated as a string and only compiled at runtime, which is slower than simply using brackets.
Examples:
#ECHO %eval(10-1)
displays: 9
#ECHO %eval(10!=1)
displays: 1
|
This must be an old help file...
"#ECHO %eval(10-1) displays: 9"
is wrong. |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Nov 14, 2009 7:22 pm |
Umm, no, "#ECHO %eval(10-1)" still displays 9 for me here just like it should. Help file is correct.
|
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Nov 14, 2009 7:23 pm |
1)what are the results if you do this in the untitled session?
2)what are the results when you do this in your specific session?
3)what version are you using?
The command is correct for #1 and #2 for me in 3.12, so if you aren't simply suffering from an operator error either something is broken in the version you are using or you are a victim of some sort of corruption and need to weed it out (meaning that it's just you). |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: Sat Nov 14, 2009 7:32 pm |
1) correct, 9
2) it returns empty lines
3) I'm in 3.12, and
4) If I remove %eval, I get 9, just as expected, in my session |
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Nov 14, 2009 8:38 pm |
That's an indication something is wrong with you, not with the rest of us. Since it could quite literally be ANYTHING, essentially it's up to you and you alone to find/make the fix.
We've all been there, it's not fun, and personally I think it's easier if not better to delete and start from scratch than to pick through large piles of triggers, aliases, etc trying to figure out what is broke but doesn't look broke (9 times out of 10, most of what you created can be safely referred to as "OMG! what the hell was I thinking when I did that?!"). |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Nov 14, 2009 9:56 pm |
Actually, I can tell you what the problem is, because I posted this same "bug" a long time ago.
DanteX, you're using numbers as aliases, right? Such as:
#ALIAS 1 {do this}
#ALIAS 2 {do this}
because if so, that's where your problem is. No, it's not going to be fixed. If you /really/ need to use numbers, then use #ONINPUT instead.
Charneus |
|
|
|
 |
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: Sun Nov 15, 2009 1:36 am |
Yes Matt, I figured as much, so I've spent whole evening creating 657965e3 new sessions in order to make one all the way without crashing... That really isn't as easy as it should be, but I'm getting there... Hopefully it'll solve many of my problems... remains yet to see.
I'm also exporting big scripts to modules... |
|
|
|
 |
|
|
|