[messages] [General Discussion] Expression Builder syntax

irishwulf irishwulf at gmail.com
Fri Jan 13 11:11:10 MST 2012


Hi,
   I've been playing around with the expression interpreter in 3.2 to
try to get it to display the value of a dynamic property in an Alert
dialog box.  I am not familiar with Beanshell, but I thought I
understood it generally used basic Java syntax.  Yet my tests seem to
indicate that any sort of variable declaration in my expression seems to
fail:
{int i;Alert("Hi");}
   returns "Expression evaluation error" in the chat window when
evaluated.
However, it does seem to be attempting to otherwise execute code blocks,
such as:
{Alert("Hi");Alert("Hi again");}
   Could you give me an idea of the sorts of things we can now put in
expression fields?  Should I be able to execute arbitrary Java?  Should
I be able to exploit evaluation shortcuts such as the following?
{isError == true && Alert("There was an error")}
   Thanks in advance, and my apologies if this has already been
addressed and I missed it.

-Seth

_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=29463#p29463


More information about the messages mailing list